LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match String + Hex-dec converter

Hi, this is my Labview program that I got so far. Basically its a program to take pH level input from a glass probe and i try to make it to display in a nice graphical way. The input that I receive from XCTU is 32 bit hex values.

 

What I'm missing right now is 2 things:

 

1st: The data is a stream of repeating hex numbers. I would like to know how to match the pattern to get a sample of it. I tried the match pattern code but it gives an error message say cant match a 1-D array of string from Source to a string type sink.

 

2nd: I want to convert the hex values into decimal, also tried the converter but I cant display the decimal values on Text rings. Error message says cant take a 1-D array unsigned long from sourse into a 1-D array sink.

 

Attached is my program.

0 Kudos
Message 1 of 3
(2,518 Views)

You need to separate your string into 8 character slices.  8 hex characters would form a 32 bit number.  You can use String Subset for that.  Feed each 8 character slice into Type Cast using a U32 numeric constant as the data type.  This will produce a U32 number from the 8 character slice.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(2,509 Views)

Two points for you

 

  • Concatenate string will convert a 1D array of strings to a single string.  Nice time saver.
  • Once you have an integer you have an integer- the numeric display properties control HOW it is displayed. select the indicator, Right-click  Show>Radix and select Decimal or Hex.  ALL integers pass BINARY data inside the wire and only objects in the UI thread know anything else about how the programmer views the values

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 3
(2,508 Views)