LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert engineering string into a number

Hello,
How can I convert an engineering string into a number with a floating point without loosing precision ?
 
Thank you
labview 7.0
0 Kudos
Message 1 of 15
(4,588 Views)
Sorry for the draft but I'm looking for something tlike this :
labview 7.0
0 Kudos
Message 2 of 15
(4,575 Views)
Well, you've made a simple task fairly complicated. What's wrong with using either Scan String or Fract/Exp String to Number? Also, don't confuse the precision of the conversion with the number of digits displayed. Right click on a numeric indicator and select Format & Precision to change the display.
Message 3 of 15
(4,570 Views)

The last VI I have done is this one (see attached file)

 

In fact it's so easy with changing directly the format and precision!!! thank you 😉

labview 7.0
0 Kudos
Message 4 of 15
(4,560 Views)

What Dennis meant is that you can use "Fract/Exp String to Number" for everything, no need to jump through all these hoops!!! 😄

It can handle all kinds of inputs with full precisions (e.g. 1234, 4.5E-12 (upper case "E"), 1.23456789e12 (lower case "e"), etc.) The attached example shows a few possible inputs together with the numeric output formatted two different ways.

(You seem to convert all decimal points to commas, thus you probably use a non-US OS (German?). If all your strings have decimal points instead of commas, you can just disable the local decimal point in "Fract/Exp String to Number" as shown. Your version actually does not work correctly on an US computer, because the commas are not recognized as decimal separator here.)

Message Edited by altenbach on 07-20-2005 12:59 AM

0 Kudos
Message 5 of 15
(4,553 Views)
Hello alten ,
 out of curiosity i would like to know  . How did you get two different formats of  indicators (one in scientific and the other in floating ), connected to one terminal in the program 'convert engineering string into a number'.
regards
renault
 
0 Kudos
Message 6 of 15
(4,540 Views)
Hello renault,

you can connect more than one data sink to a data source...

The formatting is done in the indicator (right click on the numeric indicator inside the arrays, properties or format&precision).


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 15
(4,532 Views)
Thanks Gerd . got it .
0 Kudos
Message 8 of 15
(4,530 Views)
A really neat part is that all the stuff the other guys have been telling you about can also be done programatically using property nodes so if you are writing a GUI you could have an indicator change its format and precision based on the value its displaying...
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 15
(4,429 Views)
And the winner for the LabVIEW code obfuscation is: Smiley Very Happy
0 Kudos
Message 10 of 15
(4,514 Views)