LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store string or array data received from serial port

Hello I need to store 3 different arguments of data received from serial port via visa into one value. For example I received 3 then 4 then 5 then 6,7,8,,,,,

I need to get the first argument as 345 second as 678 and so on

pleas help me

and thank you 🙂

Download All
0 Kudos
Message 1 of 3
(4,461 Views)

Hi Alex,

 

Instead of reading 'bytes at port' number of bytes from your Read Port function, you should try to read the equivalent of 3 characters. Each character being coded on 1 byte, cabling '3' to your Read Port should return a string of 3 characters at every loop iteration. Otherwise the Read Port will wait until 3 characters are present in the buffer or tiemout occurs.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 2 of 3
(4,450 Views)

Create an empty string array and connect to a shift register on the acquisition loop. Create another shift register on the acquistion loop, initialized with an empty string. As the characters are received you would append them to the string, using concatenate. When the character count = 3 append that string to the array, clearing the shift register that holds the characters.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 3
(4,448 Views)