LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error of Scan From String

Hi! Everyone!

I would like to change a string into a numeric indicator!
The source of string only includes numbers, it is released from a Case Structure.

When I chose a Scan From String to turn the string into numbers, it gives error!
The error said the input string of Scan From String is empty!
Force me to stop the program!!!

What should I do???
Is there any other methods to turn string into number???
0 Kudos
Message 1 of 4
(2,763 Views)
Hi,

It would be easier to help you if you post you code or that part of it.
In the string functions group there is a complete group named string to number conversion. There you have functions to convert strings to nembers in all formats and vice-versa.

Hope this helps, if not please post your code for us to check.
Paulo
0 Kudos
Message 2 of 4
(2,758 Views)
Give us an idea what you're doing....

Did you check the help file for the function? This tells you how to connect up the scan from string function. I've been using it for years without any real problems.

Make sure the terminals for "Format specifier" (The conversion format you want to use %d for integer, %f for floating point) "Input string" (The string you want to scan from, i.e. "12.345"). You need two inputs, one is the string with the information you want to extract, the other is a specifier which lets the program exactly WHAT you want to extract.

Then it should actually work fine.

Hope this helps.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 4
(2,758 Views)
Hi askjdhvl,

The error (code 85) that you are receiving is generated when you try to scan from a string that's empty or rather doesn't include a number. Actually it's not an "error" but just a warning that the no number was able to be scanned from the string (errors have negative code and warnings have positive code).

Make sure that you at all times pass an actual number in the string to the Scan From String function. In case you want to be able to handle empty strings, just pass the "error out" cluster from the Scan From String function to an indicator. That will prevent the error dialog to pop up, and instead you will just see the warning in the indicator. This way your VI will continue to run.



Have fun!

Message Edited by Philip C. on 06-17-2005 01:07 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 4 of 4
(2,744 Views)