LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to scan from string and keep the m (milli) specifier?!

Hi,
 
I have a problem where I'm doing a scan from string on a string that comes in as: 245m for example and stands fr voltage, yet the scan to string specifier with the following mask: @#.6p cuts off the m specifier and the end and what comes out is just 245.
 
How do i make it so it formats it into a number but keeps the specifiers like m or f at the end of the number??
0 Kudos
Message 1 of 5
(2,393 Views)
I must not be understanding what you're asking, so I apologize if I'm not answering the question. You said "scan to string". Not sure, but do you mean "Scan From String"? If so, "@#.6p" is not a valid format string. Have you tried the following:


Message Edited by smercurio_fc on 12-15-2006 11:09 AM

0 Kudos
Message 2 of 5
(2,379 Views)
That was a mistype on my part. I have %#.6p as the mask and that is valid, but for some reason my number defaults to I32 instead of a float. I don't understand why.
0 Kudos
Message 3 of 5
(2,370 Views)
What version of LabVIEW are you using? The format string you gave works just fine in 8.2 (though it's not necessary, as "%p" is all you need when using the "Scan From String" function). In 7.1 (and in 7.1.1) the "Scan From String" outputs an integer with "%p". I remember reading someplace about some bugs with that function in 7.1. This is probably one of them.
Message 4 of 5
(2,363 Views)
You're absolutely right, it's 7.1 and I did read about that bug too. Unfortunately we'r releasing a major version of our software package this month and can't afford to upgrade to 8.2. To fix this error I had to do a little workaround and create a subvi that accepts a string, feeds it through the scan from string func since it works and the output will be a double if the display that you feed it to is just that, a display, it'll default to integer if it's a cluster or bundle that's being fed as is the case in our application. Thanks for your help!
0 Kudos
Message 5 of 5
(2,354 Views)