LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading only number value from data packet?

Solved!
Go to solution

I have an input that gives me:  122345,%,0000,0000

 

I just want the 122345 part so that i can graph the value in real time as the data is being streamed into the computer. How do I select for this? Right now I just have a straight read command and the read buffer indicator I have just cycles through the packet depending on how many bytes i tell it to read.

0 Kudos
Message 1 of 4
(2,537 Views)
Solution
Accepted by topic author superomario

Look at the string to number formatting functions in the String palette.  If the values are always integers and always at the beginning of the string, the Decimal String to Number function will work without any additional effort.

 

Lynn

 

String conversion.png

Message 2 of 4
(2,531 Views)

Hey superomario,

 

Two other options to consider are the String Subset and Search/Split String. The first returns a subset of a string that is "length" characters long starting at the character designated by the offset. In your given input, you would use a length of 6 and an offset of zero. The latter VI splits a string at the first instance of a user defined character, in your case a comma. Take the "substring before match" output and you will get the desired result you requested.

 

Hope this helps

 

Luke W

0 Kudos
Message 3 of 4
(2,515 Views)

..

 

Luke W

0 Kudos
Message 4 of 4
(2,515 Views)