Serial input that can't use the serial branch
Posted: Sat Aug 06, 2016 4:44 pm
Good Afternoon-
I am trying to get serial data from a RFID reader and the data is in the format:
1.9600bps,N,8,1
2.CHECKSUM: card 10byte DATA entire do XOR operation
|-02-|-----10 ASCII Data Characters-----|-----Chechsum-----|-03-|
Output date(HEX): 02 | 30 31 30 30 30 37 33 34 45 30 | 44 32 | 03
->Change to Decimal
CardNumber Decimal: 48 49 48 48 48 55 51 52 69 48
CheckSum Decimal: 68 50
->Refer to ASCII table,get Ascill value
CardNumber Ascill: 0 1 0 0 0 7 3 4 E 0
CheckSum Ascill : D 2
(01H) xor (00H) xor (07H) xor (34H) xor (E0H) = D2H
How would I read the data when I don't know when a read will take place, and it does not terminate with a CR/LF?
As a test code I have tried the below but nothing prints when I bring a card near the coil
Maybe a serialbranch with a known character length????
OR trigger on a sync byte???
New idea for the interpreter??
I am trying to get serial data from a RFID reader and the data is in the format:
1.9600bps,N,8,1
2.CHECKSUM: card 10byte DATA entire do XOR operation
|-02-|-----10 ASCII Data Characters-----|-----Chechsum-----|-03-|
Output date(HEX): 02 | 30 31 30 30 30 37 33 34 45 30 | 44 32 | 03
->Change to Decimal
CardNumber Decimal: 48 49 48 48 48 55 51 52 69 48
CheckSum Decimal: 68 50
->Refer to ASCII table,get Ascill value
CardNumber Ascill: 0 1 0 0 0 7 3 4 E 0
CheckSum Ascill : D 2
(01H) xor (00H) xor (07H) xor (34H) xor (E0H) = D2H
How would I read the data when I don't know when a read will take place, and it does not terminate with a CR/LF?
As a test code I have tried the below but nothing prints when I bring a card near the coil
Code: Select all
baudrate 9600
[start]
serialinput ID
print ID
goto [start]
Maybe a serialbranch with a known character length????
OR trigger on a sync byte???
New idea for the interpreter??