01-27-2012 10:05 AM
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
Solved! Go to Solution.
01-27-2012 11:27 AM
If you always have exactly five \x00 separating the numbers, I'd use something like this:
01-27-2012 12:51 PM
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
01-27-2012 01:55 PM
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
01-28-2012 11:44 AM
@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.