LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan string issue

hello everyone, i have a issue with labview, i am using a scan string to separate the input string about some result of one test

but i can't to separate the input string with the function scan from string

 

if someone can help with the code what i need to place on the function scan from string to separate each test result in separate strings

Thank you

0 Kudos
Message 1 of 6
(386 Views)

I would recommend using Spreadsheet String to Array instead of Scan from String for this.

 

You will need to change the delimiter to a comma.

 

Also, is there a chance you're located in a place where the default decimal separator is a comma instead of a period?  That can confuse both Scan from String and the spreadsheet string to array function unless you compensate for it.

 

Also, if you can post a full VI that we can run that shows the problem that's a lot better than posting a picture.  Save it back to ~2018 version if you're on a more recent version since not everyone updates to the most recent one.

 

 

0 Kudos
Message 2 of 6
(378 Views)

Try using %e instead of %f.  This is to tell the Scan From String to use Scientific Notation instead of a simple Floating Point.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(377 Views)

The other part of the Vi is only the run test of a equipment 

Ignacio564_0-1711995596961.png

i have changed the scan from string to spreadsheet to array and it works but i want the entire number with decimals, can help with the code what i need to place to get all the number? 

 

thanks

0 Kudos
Message 4 of 6
(357 Views)

I finally got around to being able to test this inside of LabVIEW.  Your code worked fine for me.  My suspicion is that your system is configured to use a comma as the decimal place instead of a period.  You need to add %.; to the beginning of your format string in order to tell the Scan From String to use the period as the decimal place.  Your full format string should be "%.;%f,%f;%f;%f;%f;%f;%f".  But as previously stated, you will be better off using Spreadsheet String To Array.

 

EDIT: I did test this with using "%,;" at the start of the format and got the same results of the OP.  With that information, I cam 99% sure this is in fact the issue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(340 Views)

Thank you sir, i have made the change to spreadsheet array like your image and it works

Ignacio564_0-1711998507774.png

the values are placed with comma but for me it's fine, i have the info from the test separated in array, now i can work with that information.

 

Thank you very much for your help

0 Kudos
Message 6 of 6
(323 Views)