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.
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.