LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 Serial Packet Forming Question

I am trying to form a serial packet to be sent over a ZigBee serial modem in LabVIEW.  The packet needs to contain things like the network address, the device ID, the message length, the actual data, and finally a checksum.  I'm having trouble figuring out how to build this packet.  More specifically I'm not sure how I need to format the data in order to send it over a serial connection, should I make it a string of hexadecimal characters? a byte array?  I'm not sure what format the VISA write expects the data in, in fact I'm not even sure that VISA write is really  the best function to write to the serial port for my application.

 

Attached is the code, the portion of the code that is of relevance is the on the bottom of the block diagram.  Thanks in advance.

 

0 Kudos
Message 1 of 2
(2,782 Views)

There is a big difference between using a string with hex format and using ASCII characters made to look like hex. You should right click on your string constants and select Hex Display. Using an array of U8 and the Byte Array to String will also work (and is what I prefer). It would also make the checksum calculateion easier.

 

Search the board for 'hex serial communication'. There must be hundreds (maybe thousands) of threads on the subject. The calculation of a checksum is heavily covered as well.

0 Kudos
Message 2 of 2
(2,776 Views)