How to format manufacter given command?
Posted on 2006-04-25
Hi, i have written an app that writes a datastring to the comm port every second. When i used the monitoring ultility provided by the multi port board vendor...it appears..that the port has been successfully opened and data are transmitting. But my device don't seems to be acting upon receiving the data...... Anyway maybe i could have the datastring format screwed up.
Here's the datastring format given
<STX><POL><5 byte Ascii data><Space><PCS><CR><LF>
STX is chr(12),
POL which is either -ve or +ve...which is always chr(43) in my case
5 byte Ascii Data - i hardcoded it to be 55555
Space which is chr(32)
PCS which are 3 bytes chr(80), chr(67) and chr(83)
CR - return carriage chr(13)
LF - LineFeed chr(10)
In my code...i put it as
myValue = 55555
str_tx = chr(12) & chr(43) & myValue & chr(32) & chr(80) & chr(67) & chr(83) & _
chr(13) & chr(10)
I am not sure if it is the way present my datastring.... By the way....if i were to type to above string using hyperterminal...how do i present it? like? STX+55555 PCS
what about the CR and LF and space character when testing it with hyperterminal?