LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string to real

Hi, 

 

I am working with an instrument to read the internal resistance of motors.  the problem is that I am reading strings and I have to convert them to real.

the Instrument is working that way: 

if I have a resistance of 200kohm => 200E3 

20 ohm =>20 E0 

2mOhm=>2E-3 

 

I used convert to string but its arrounding my numbers.. which is impossible to work with because I need the whole number.

I also used Fract/exp to string buit this is what I am getting

 Capture.PNG

 

You will find attached my program, please I need your help

 

0 Kudos
Message 1 of 5
(3,775 Views)

Please reduce your VI to a simple example that contains typical strings as a diagram constant. and just includes your conversion and the array indicator. Unless we know how the strings look like exactly, we cannot tell what's wrong. (for example is there really a space inside "20 E0")

 

0 Kudos
Message 2 of 5
(3,758 Views)

Hi, 

This is the exact type of string that I am reading from the instrument 

Capture1.PNG

I also tryed yith the function scan from string version with %f but I am having this result

Capture2.PNG

 

BR

0 Kudos
Message 3 of 5
(3,748 Views)

Hi karate,

               Use the attached Vi snippet and the issue will be solved. you have to select Frac/Exp string conversion so that you get the exact resistance value.

 

 

The issue is solved

 

Kudos welcome 🙂

 

 

Regards 

Santhosh Joel

Certified-LabVIEW-Associate-Dev_rgb (2).jpg

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
0 Kudos
Message 4 of 5
(3,733 Views)

Make sure you have the Fract/Exp String To Number setup to NOT use the System Decimal Point.  If appears your localization uses the comma as the decimal point while the instrument uses a period.  Setting that boolean to FALSE will allow you to read the strings with the period decimal 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 5 of 5
(3,722 Views)