LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format specifier HELP

Solved!
Go to solution

I read this transmition from COM port 1 using VISA Interactive Control.

 

+0.0000000E+00\x00\x00\x00\x00\x00 -0.3127200E+02\x00\x00\x00\ x00\x00 +0.0000000E+00\x00\x00\x00\x00\x00 +0.0000000E+00\x00\ x00\x00\x00\x00 +0.0000000E+00\x00\x00\x00\x00\x00 +0.0000000E+ 00\x00\x00\x00\x00\x00 \x00\x00\r\n

 

I am using the Scan from String Function.

 

I need the Engineering format Numbers and want to ignore the "\x00". the space " " and then acquire the second number "-0.3127200E+02". And so on!

 

I have tried many different format specifiers without much luck! (I recieve only the first number)

 

Any help for a new user out there?

 

Thanks, Ross

 

 

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

If you always have exactly five \x00 separating the numbers, I'd use something like this:

search replace string to array.png

Message 2 of 5
(2,766 Views)
Solution
Accepted by topic author Ross Stewart

 

You helped me! The characters \x00 were just representations of the VISA INTERACTIVE CONTROL, In the data stream they were actually

 binary 0000 0000 0000 0000. I used search and replace patternVI to remove all characters I was not needing from stream. Thanks for your time, It lead to the answer I needed! THX

 

 

snippet.png

0 Kudos
Message 3 of 5
(2,761 Views)

The regex you're using will also remove the decimal point and it will not remove the useless zeroes. If it is the second value that you want and the strings all have the same pattern (a 0 value, the significative value, 3 sets of 0 values) you can use the following code to extract them all. It will also work with an input string that contain multiple lines.

 

Ben64

 

Multiple Line Regex Solution.png

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

@Ross Stewart wrote:

 

You helped me!  THX

 


Then you should mark Nathan's post as the solution to your question rather than your thank you post.  Please, go to the options menu to the upper right of your message to unmark your post as the solution so you can then go and properly mark Nathan's post.

0 Kudos
Message 5 of 5
(2,731 Views)