LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way parsing visa serial read

Solved!
Go to solution

Hello everyone,

 

This is my first LabVIEW experience.

I'm working in front of a custom board that has several sensors.

 

At the board stage, I'm packing all data from the sensors ( digitals inputs & ADC - analog inputs ) to one buffer and send it through UART to the PC (Labview).

Now at the Labview stage, I need to get all packed buffer as HEX string parsing it and show the analog / digital read inputs 

 

The VISA works properly, with a termination character. 

 

Now I wondering :

1) what is the best way to parsing the string buffer - read it on the fly parsing and separating all inputs.

2) How to convert string HEX to waveform?

 

Thanks in advance.

 

0 Kudos
Message 1 of 7
(2,423 Views)

It helps if you attach your VI with some data saved in it as an example of what you receive.

 

You say it is "string Hex".  That had different meanings to different people.  I interpret it as a string of human readable characters of 0-9,A-F.  Is that true?

In which case you can use Hex String to Number to convert the characters to values.  You can do it in a loop.  There are lots of people asking for the same thing on the forum.

 

Since you say it ends in a termination character,  (line feed, carriage return?), I would to a VISA read with more bytes than the longest message you ever expect to receive.   Now you have a complete packet of data, you can parse at once and send the various values out to where they belong.

0 Kudos
Message 2 of 7
(2,415 Views)

Thanks for your help. 

 

@RavensFan wrote:

You say it is "string Hex".  That had different meanings to different people.  I interpret it as a string of human readable characters of 0-9,A-F.  Is that true?

 


Yes, it's correct.

I'll search for example

 


@RavensFan wrote:

Since you say it ends in a termination character,  (line feed, carriage return?), I would to a VISA read with more bytes than the longest message you ever expect to receive.   Now you have a complete packet of data, you can parse at once and send the various values out to where they belong.


What is the best way to parse the reading buffer ??? If you can direct me to example it will be great.

 

 

0 Kudos
Message 3 of 7
(2,406 Views)
Solution
Accepted by topic author moranfarky

Like this.

 

There are certainly several other ways to do it.

 

 

0 Kudos
Message 4 of 7
(2,403 Views)

I really appreciate your help.

 

Can you please send it as VI and not png because I'm not familiar with all converters and the modules you used for the parsing.

 

Again, thank you.

0 Kudos
Message 5 of 7
(2,348 Views)

Hi moran,

 


@moranfarky wrote:

Can you please send it as VI and not png because I'm not familiar with all converters and the modules you used for the parsing.


That images is a "snippet": download that image and drag it into your block diagram.

(Read the LabVIEW help for "snippets"!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(2,318 Views)

Great to know. 👌

 

Thanks.

0 Kudos
Message 7 of 7
(2,311 Views)