06-06-2023 06:42 PM
Dear Community People,
I am using LabVIEW to get flow rate data from LabVIEW. I made an easy code(withoutwhile_loop.vi) using visa write and read. It reads the command. For example, for @253FR6?;FF it usually returns @253ACK-1.100E-2;FF. Here 1.100E-2 is my desired flow rate.
However I want to read this data continuously. So I used a while loop in 500ms wait time(withwhile_loop.vi). Now when I run the loop for each iteration, the read value is different. For example, for first iteration, it is @253ACK-1.100E-2, for 2nd iteration it is ;FF@253ACK-1.1, for others it is something else. I want the code to show in @253ACK-1.100E-2;FF format everytime so that after each iteration I can extract the value(For this case -1.100E-2).
Could anyone help me what I am doing wrong exactly?
I have attached both of the code.
Additionally, how to find out what's the correct byte count?
Thanks.
Solved! Go to Solution.
06-15-2023 02:01 PM
Hi
In the first iteration you read @253ACK-1.100E-2;FF
Including all characters this is 19 character and you only ask for 16, what happens?
You better can ask for 100 chars and have a semicolon as end character.
Look at the examples\Instrument IO\Serial\Continuous Serial Write and Read.vi
You can get at this by help/find examples and then type in serial
They use char 10 as endcharacter, you should fill in the ascci value of the semi colon.
06-15-2023 02:05 PM
You might want to also give this a watch: VIWeek 2020/Proper way to communicate over serial