LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan from string problem with SI formatting

I ran across a problem today which caught me off guard.

 

I wanted to save a comma seperated list of SI-formatted values to a file for reading in later.  SI format (100u instead of 0.0001) is easier to read, even without physical units.

 

Problem is that I can't read them in any more.  As soon as there are more than one entry in an in0put string, Scan from String seems to fail with the %p formatter.

 

 Scan from string error.png

 

Can someone see if I'm not completely insane?

 

Shane.

0 Kudos
Message 1 of 11
(3,181 Views)

You are not crazy.  I remember running into this issue in 2011.  I want to say I had the problem in 8.6 as well.  I think in the end, I just used a different format.


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 2 of 11
(3,160 Views)

Do a spreadsheet string to array and convert each with %p, it should work. 

A quick test showed that %p worked well with 1 value, but not any more.

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 11
(3,156 Views)

@crossrulz wrote:

You are not crazy.  I remember running into this issue in 2011.  I want to say I had the problem in 8.6 as well.  I think in the end, I just used a different format.


Well I've already changed the code to use a different format, but why (logically) should this conversion fail?  There are no SI units which use a comma, right?  The same problem occurs with semi-colon separated values and space-separated values...

 

I would call it a bug.  Or at least if it's intended behaviour I need a good reason why.

 

Shane.

0 Kudos
Message 4 of 11
(3,138 Views)

Intaris wrote:

I would call it a bug.  Or at least if it's intended behaviour I need a good reason why.


I fully agree.  I could not come up with anything remotely logical as to why it wouldn't work.

 

Here's an approximation of what I was trying to do (once upon a time).  Bacially, I wanted whole units with SI notation.  Ended up with some weird resuts.


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 5 of 11
(3,135 Views)

Hi guys,

 

thank you for your post. it seems like, that there is some inconsistence in the behaviour here.

 

I fully agree with you and I will contact our R&D department to look for an answer.

 

Best regards,

Abduelkerim

Sales
NI Germany
0 Kudos
Message 6 of 11
(3,097 Views)

Hello everyone,

 

Abduelkerim has filed a Corrective Action Request on this behavior (CAR #368645), but I wanted to make a quick post about some experimenting I did with your VIs this morning. It appears that if there are two spaces after a SI modifier that the Scan From String VI behaves more like we would expect. I've attached screenshots of this below. The important thing to note is that every blank area you see is actually two spaces instead of one. I was unable to find this behavior documented anywhere, so I'm adding it to the CAR as well.  In the meantime, hopefully people who stumble across this thread will find this information useful.

 

SI_three_SI_no_space.png

 

SI_three_SI_comma.png

 

SI_one_SI_one_string.png

0 Kudos
Message 7 of 11
(3,070 Views)

Drew,

 

This is a long shot, but is there any possiblilty that this issue may be related to the units issue which has been discussed in the past few days?  Sorry, I did not take the time to search for that thread.

 

Lynn

0 Kudos
Message 8 of 11
(3,049 Views)

Lynn,

 

this is broken in LV 8.5 as well (which I'm currently using), so I think it's been around for a long time.

 

Shane.

0 Kudos
Message 9 of 11
(3,041 Views)

Unfortunately, I agree with Shane.  I'm pretty sure I did a thorough search of CARs for this and came up empty, but if they kick it back for being a duplicate, I'll update the CAR # to this thread.  Since it's been around so long, there's a good chance we might have missed something in our search.

0 Kudos
Message 10 of 11
(3,026 Views)