LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the InstallComCallback function

Hello,
I implemented the InstallComCallback function and set it to be called whenever 0x55 is recieved. But, when I read the first byte (from within the callback) it isn't 0x55. How is that possible? If the callback is called when 0x55 is recieved, then the first byte read should be the 0x55!
Thank you
0 Kudos
Message 1 of 3
(3,187 Views)
Hello-

The callback will run when 0x55 is received, but ComRd will return all the data contained in the serial buffer at that time. This includes data sent to the serial port before 0x55. Since this buffer is a first-in-first-out (FIFO), the 0x55 will probably be the last character read from the buffer.

This technique can be used to set the termination character of the serial bus. So, when data is received, the application will retrieve the incoming data only after it receives the termination character.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,187 Views)
Hello Randy,

I'm also trying to use a callback to detect packets. I'm using the following format . I cannot check on the checksum so i check on the "end". How do i read the checksum after receiving a callback ?

Thanks,
Bart
0 Kudos
Message 3 of 3
(3,187 Views)