LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Integer part only

Solved!
Go to solution

Hi everybody,

 

I'm a brand new user of Labview (v 2009). I try to save some data from my electrometer (Keithley 617) in an array (time and electric current). And it works, I can see these data in a text file, with the time on the left, and on the right the value of the current. The issue is that I can only record the integer part. The current I try to record is something like 10E-12 A. So if I don't multiply the result by a constant of 10E15 for example, the result would be 0 instead of 0.00...004658 A. And it is the same for the time. I can see 1, 1, 1, 2, 2, 3, 3 instead of 1.034, 1.45, 1.89, 2.36, 2.98, 3.48, 3.95 for example. I've try to change the format, but it doesn't solve this problem of the integer part. I'd like to see the whole number (integer and decimal parts). Attached, please find my program. Also I attached 2 files. test01 is what I'd like to record, and test02 is what I currently record. Could you help me please ?

 

Thank you !

 

PS : I try to expose as best as I can my problem, I'm French...

Download All
0 Kudos
Message 1 of 9
(3,428 Views)

Try "%g" instead of %f as a format specifier


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 9
(3,405 Views)

Hi thom,

 

what kind of decimal separator do you use (over there in France)? Is it set to comma or point?

You should use the point for all measurement device related tasks, as those devices are usually using it!

 

When saving your data you can enforce a certain decimal separator by including it in the format string. See the LabVIEW help for all format codes…

 

Btw. why do you wildly mix DBL and EXT numbers? Did you notice all those red coercion dots?

 

@Jeff: Even with %f those time values (like 1.034) should be included correctly in the file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 9
(3,402 Views)

or use %.6e to output as in test01.txt

 

Ken 

0 Kudos
Message 4 of 9
(3,396 Views)

I've just tried "%g" as you told me, but no change.

0 Kudos
Message 5 of 9
(3,391 Views)

Ken, same thing, it doesn't work.

0 Kudos
Message 6 of 9
(3,386 Views)

GerdW,

 

I use point, I'm French but I work in USA. Could the red coercion dots be a problem for my program ? What should I do ?

 

 

0 Kudos
Message 7 of 9
(3,380 Views)

Are you getting the expected strings from your GPIB Read.  Write the string output to a text file and post it please.

 

Ken

0 Kudos
Message 8 of 9
(3,371 Views)
Solution
Accepted by topic author thomUConn

Ok I think I found a solution. A double precision float "DBL" was missing just before the "measurement" part. I attach you my program and the results.

 

Thank you for your help !!

 

Thomas.

Download All
0 Kudos
Message 9 of 9
(3,362 Views)