LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to number

 


@KF_ wrote:
Can I use type cast then?.

 

No, because yoiu are dealing with a decimal formatted string, not a binary string.

 

What is that exercise all about? For ideas about formula parsing, have a look at the built-in formula pasing tools. The internal code is not hidden and can be freely inspected.

 

At first glance, your code makes little sense, and I am not about to study it in detail. Still, I don't understand why you have problems with precision. Doesn't it simply use whatever decimal digits are in the string?

 

Why are all panels maximised to the screen?

 

 

 

 

0 Kudos
Message 11 of 15
(659 Views)

The code works though, first it removes all spaces in the formula (edit formula), then it looks for possible ln strings (ln parser), calculates the ln and puts back a number into the string, then the only thing remaining in the string are basic operations (+,-,/,*) and this string is passed to the basic parser, which calculates the formula. If you want to parse other types for instance, likes parentheses, you can just add it to the list.

 

For instance when it calculates the natural logarithm, i get a decimal number and I have to put that number back into the string where the ln was located. But the number I get in the string only has 6 numbers behind the comma, or how many I specify. But I want to have the number labview calculates untill machine precision.

 

Also I have professional development system, not full, so I can't check the built in parsers.

 

What do you mean with the maximised panels?

0 Kudos
Message 12 of 15
(653 Views)

 


KF_ wrote:

Also I have professional development system, not full, so I can't check the built in parsers.


 

"Full" and "professional" should have the parsing tools. They might be missing from the "base" version.

 

Maybe you need to complicate your data strutures a bit and keep intermediary results as DBL instead of putting it back into the string. Still, I don't see why precision matters so much here. Are you trying to land on mars?

 

If I open your VIs, all front panel and diagram windows are maximised to the screen. I find that annoying. 😉

0 Kudos
Message 13 of 15
(640 Views)

Do you work with a minimized block diagram? I wouldn't be able to see a thing, or maybe it's just my programming scructures Smiley Tongue

0 Kudos
Message 14 of 15
(627 Views)

Your VIs have very little stuff on the front panel, so why do they need to fill the entire HD screen, blocking everything else?

 

The alternaitve to "maximized" is not "minimized", but sized to a reasonable window so several subVIs can be seen at the same time for better programming coherence. If you can look at only one diagram or front panel at any give time, workflow is seriously impaired.

 

(The big diagrams have a different problems. I was not talking about them. You simpler toplevel VIs have code the size of a postage stamp and the diagram is still maximized to the screen) 😉

0 Kudos
Message 15 of 15
(619 Views)