LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication using serial compatibility VIs does not return correct bytes at Bytes at Serial Port vi

Hi! All,
I am developing a application which communicates with serial device
using compatibility VIs(as these VIs are for PDA).
When I use "Bytes at Serial Port" to get the desired number of bytes
to be read, it returns me the length of the bytes I wrote to the
serial port and displays the same command(which is been written on the
port using Serial Write.vi) in the Read Serial output terminal.
I am using sequence to manage the flow of the serial initialization,
write, bytes at serial port and serial read. I even have wait
function in both serial write and serial read sequences.
Any suggestions?
TIA
Rachana
0 Kudos
Message 1 of 3
(3,060 Views)
Most likely it is because the "Termination Character", if it is enabled, by default it has hex value 0x10 . If this character is presented then a single serial read only returns everything before the termination character, regardless the number of bytes available at the port. You will need to put the "Bytes at port" and "serial read" in a loop.

-Joe
0 Kudos
Message 2 of 3
(3,060 Views)
A note that some PDAs (as we're finding here) have a local echo of everything that you send to the serial port. You may have to parse your input to remove the sent command and then read again to get any new input. A pain and it doesn't happen with all PDAs, so if you're only working with one type, you shouldn't have too much difficulty.

Rob
0 Kudos
Message 3 of 3
(3,060 Views)