LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Applying mathematical operation of string of data

Solved!
Go to solution

I am interfacing a power supply (Agilent E3631A) via GPIB. When PSU is switched on to 12v and a device is consuming 104mA current, the read vi is giving a string of data +1.04485600E-01. Now this data shown is right but I want it to appear on Front panel as 104 or 0.104 instead of exp format +1.04E-01. One way is to multiply it with 10 and one way is to divide with 100 and may be ways to convert it to a simple decimal format. Can any body help me to get simple 0.104 or 104 out of the above string please.

 

 

 

     

0 Kudos
Message 1 of 3
(3,007 Views)
Solution
Accepted by topic author 01274556865

If this is the exact string response then you can use the Frac/Exp String to Number function to interpret the string content into a Double. You can then use a Front Panel numeric indicator with the display format set however you desire to ensure you get a rounded number. I think a format specifier of  "%.3f" should give you 0.104

 

fractostring.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 3
(2,998 Views)

Thanks a lot for your help.

0 Kudos
Message 3 of 3
(2,974 Views)