LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpreting ASCII data into numerical values

Hello all, 

 

I'm currently connecting an Omega HHP82000 digital manometer and an Omegaette HH311 Psychrometer through raw USB using NI VISA. LabVIEW sees the devices and is able to obtain data from them, but the data only comes in various ASCII symbols, specifically "x", "€", and "⁰". If I re-run the test, the order of these symbols changes, so I'm pretty sure that there is different data coming consistently through the device. Is there a way for me to get legible numerical values from this output that I can then manipulate through equations? 

 

0 Kudos
Message 1 of 5
(2,449 Views)

Several options are available depending on what is coming across the USB link.

Try using LabVIEW help to read up on the following functions.

image.png

Of corse, the other option is to change the data coming out of the insturments. Pretty sure if you read the manual, there will be options for changing outputs to regular ascii characters. (as apposed to binary data) Keep in mind there well be a performance hit using ascii.

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 2 of 5
(2,438 Views)

The best way to do this is to start by reading the manual.  It should tell you how to interpret the "symbols".  Maybe they represent numbers in binary, like U8 or I32, or doubles.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(2,413 Views)

I realize I should have mentioned that the data is coming through an RS232 to USB cord. I tried all three of those options, and while it did convert it to a readable value, the value is usually somewhere around 2 billion. If I place it in a loop, the number consistently changes regardless of if I hold the data on the device, which leads me to believe that it's reading something other than the value displayed on the device's screen. Here's what I currently have. I couldn't find anything related in the manuals so that was a dead end as well. Any advice will be appreciated.

Labview Code.JPGLabview Output.JPG

Thanks

0 Kudos
Message 4 of 5
(2,396 Views)

Hi yoshable,

 

I realize I should have mentioned that the data is coming through an RS232 to USB cord.

That doesn't matter.

It would be more important to attach the manual of your device - or read it yourself!

 

I tried all three of those options,

But you failed in attaching a VI with some default read data from your device.

And you failed in setting the string display to \-code before making that screenshot.

Did you know we cannot debug images using LabVIEW?

 

So please:

- attach the manual (or provide a link!)

- attach a VI with some default data from your device!

- give the expected output for the attached default data: it is much easier to provide a conversion rule when we know the expected result from your data!

 

On that screenshot:

There is no example VI for LabVIEW where the port is opened and closed with each iteration of your loop. So why do you do that? (Even worse: why do you open the port with each iteration, but close it only once after the loop?)

Best regards,
GerdW


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