Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

receiving serial commands from microcontroller to serial port of PC with LabVIEW

Highlighted

Hi all,

 

I am developing an application where i need to interface serial port of PC with Labview and a microcontroller. I need to receive and transmit serial commands to microcontroller in a packet format(The packet of 5 bytes that includes header, data length, id, data and checksum). 

 

I have successfully tested the VISA serial read vi and serial write vi for Tx and Rx 1 byte data , but have no idea of handling packet format where i also need to validate the  packet data received. 

 

Kindly provide me any suggestions.

 

with regards,

Sri

0 Kudos
Message 1 of 2
(2,575 Views)
Highlighted
You've got the first step. As you receive each single byte, see if it's the header. Once the header is found, read 4 bytes. After that, you are synched and each read would be 5 bytes. The string to bye array function would then be used and you can index any element you want.
0 Kudos
Message 2 of 2
(2,568 Views)