LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI measurement problem

Solved!
Go to solution

I have a small code which works as follows: DO up -> measure 3 AI channels -> DO down. Code works at some level, but I am having trouble with the results. It gives me voltage level without decimals. I have checked properties and there is 6 significant numbers accuracy. Tried some other tricks too but didnt get them to work. Any ideas?

 

2 channels should give -2.xx V and one channel 2.xx V

 

Instrument is Keysight U2355A

 

 

Download All
0 Kudos
Message 1 of 8
(3,561 Views)

Hi LW,

 

Code works at some level, but I am having trouble with the results. It gives me voltage level without decimals.

Are you using the "default" driver VIs for your device - and use a computer with a different than the English decimal separator "point"?

It's pretty common to device drivers to expect default English regional settings…

Best regards,
GerdW


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

Hi Gerd,

 

I noticed my "mistake". I clicked the box saying "hide trailing zeros", and there my decimals were. But measurement should not be 2.0000. I am not quite sure, what I am doing wrong here.

0 Kudos
Message 3 of 8
(3,543 Views)

Hi LW,

 

I noticed my "mistake". I clicked the box saying "hide trailing zeros", and there my decimals were.

Wrong, next mistake!

You can show as many decimals as you like, but when the values are integers you only get zeros…

 

But measurement should not be 2.0000. I am not quite sure, what I am doing wrong here.

Did you read my previous comment (and did you understand it)?

Best regards,
GerdW


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

@GerdW wrote:

Hi LW,

 

I noticed my "mistake". I clicked the box saying "hide trailing zeros", and there my decimals were.

Wrong, next mistake!

You can show as many decimals as you like, but when the values are integers you only get zeros…

 

Aah, this explains it.

 

But measurement should not be 2.0000. I am not quite sure, what I am doing wrong here.

Did you read my previous comment (and did you understand it)?


Yeah. Answer is yes and yes. (to drivers and computer). How I can fix this?

 

0 Kudos
Message 5 of 8
(3,535 Views)
Solution
Accepted by topic author LWnew

Hi LW,

 

Answer is yes and yes. (to drivers and computer). How I can fix this?

Two options:

1. Set your computer to use English numeric formats (point as decimal separator, comma as thousands separator). Restart LabVIEW after changing the settings.

2. Create a copy fo that device driver and save it as backup. Then edit the Keithley driver to respect your local settings by applying proper format strings for each and every conversion between numbers and strings… (Don't forget to call Keithley and complain about the bad quality of their official drivers!)

Best regards,
GerdW


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

Wow, it actually worked. I am almost tempted to call them due stupidity of this.

 

Thanks.

0 Kudos
Message 7 of 8
(3,520 Views)

HI LW,

 

I forgot a 3rd option: switch off the option to use the local decimal separator in the LabVIEW options dialog.

 

I prefer the two options I gave in my previous message, because:

1. using English locale settings gives the least problems with measurement data and external/3rd party DAQ devices.

2. settings proper format codes in your own VIs is a good learning topic for creating "good" code…

 

(The 3rd option above is the worst of them all because then all your LabVIEW programs behave different then most other software on the same computer…)

Best regards,
GerdW


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