LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve data from the serial port and decode it each 2 bytes is a long variable and 1 frame is about 6 bytes

I send the frame by a microcontroller ( 8bits) the fram contains 6 bytes, 2bytes conform a long variable, I want to decode the frame and make operations with these long variables and then plot them
0 Kudos
Message 1 of 2
(2,589 Views)
Hey jpvans,

I would first suggest using NI-VISA to talk to the serial port. Then, you can use the LabVIEW Type Cast or the Flatten to String and UnFlatten From String VIs to convert the data.

You can setup the read so that it reads just two characters at a time to form an individual long or you can set the read up to read it all and then use the string functions like String Subset to cut the information into chunks.

I hope this helps out.

JoshuaP
0 Kudos
Message 2 of 2
(2,589 Views)