LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting an engineering string to a general number

Solved!
Go to solution

Hi everyone,

 

Does any know how to convert an engineering string to a normal formated string?

 

Thanks

0 Kudos
Message 1 of 10
(5,185 Views)

What do you mean by an "engineering string"?  What is a "normal formatted string"?

 

Perhaps you can give us an example of what the string looks like now and what you want it to look like.

0 Kudos
Message 2 of 10
(5,177 Views)
The engineering string outputs a number in sicentific notation (1.10E-01), where we would like to display the number as -.11.  However, this only seems to occur when the number is exported to Excel and when it is close to zero (within a fration of 1).
0 Kudos
Message 3 of 10
(5,173 Views)

Do you mean Fractional / Exp to numeric Function?  which is located under the strings palette.. under String / Number Conversion.

 

 

Fract/Exp String To Number

Interprets the characters 0 through 9, plus, minus, e, E, and the decimal point (usually period) in string starting at offset as a floating-point number in engineering notation, exponential, or fractional format and returns it in number. The connector pane displays the default data types for this polymorphic function.

 

0 Kudos
Message 4 of 10
(5,172 Views)

Example using Ray's function.  One is an actual number, the second converts that number back to a string with default precision of 6.

 

Message Edited by Ravens Fan on 06-10-2009 02:42 PM
0 Kudos
Message 5 of 10
(5,169 Views)
Is there any way to do this with multiple 1-D array inputs?
0 Kudos
Message 6 of 10
(5,164 Views)

Hi nem,

 

the functions shown by RavesFan also accept array inputs...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(5,161 Views)

Attached is the part of the vi  that write the data to a .txt file which is then opened in Excel, However CH2-01 in Excel reads a scientific notation format.  Trying what was said didn't work due to different source and sink types.

0 Kudos
Message 8 of 10
(5,154 Views)
Solution
Accepted by topic author nem

Hi nem,

 

in your vi there is no "CH2-01". Do you mean "DAQ21"?

 

See attachment for some minor changes (removed sequence, locals, build path a better way). Why do you split your arrays into 4 parts when you need to re-build all arrays again?

 

Are you sure it's not an Excel formatting problem? Did you set all numbers in the excel sheet to display as "numbers"?

When I try your vi I don't get any numbers in scientific format in Excel. (And I would suggest to transpose the data for Excel import...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(5,138 Views)
Thanks for your help and suggestions on the block diagram, it was much appreciated.
0 Kudos
Message 10 of 10
(5,133 Views)