LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Using LabVIEW 2014 to Control Keithley 2401 for Voltage Measurements

Hi everyone,

I'm currently using LabVIEW 2014 to control a Keithley 2401 for voltage measurements. In my setup, a Keithley 6221 serves as a current source, supplying current to the device under test, while the 2401 is used to measure the resulting voltage.

The voltage measurements are automated in LabVIEW. The 2401 is programmed to perform multiple measurements inside a loop, and after each measurement, I read the voltage value using VISA Read. I also include a Wait(ms) function before each read to provide a small delay between operations.

The problem is: after a certain number of successful reads, the 2401 suddenly stops returning data, and the program freezes during the loop. I am forced to manually abort the execution.

Even if I remove the loop and perform the same measurement one by one (manually or through sequential steps), the problem still occurs — typically around the 17th measurement, the 2401 fails to return any data and gets stuck.

Has anyone experienced a similar issue or knows what might be causing this behavior? Any help or insights would be greatly appreciated.

Thank you!

0 Kudos
Message 1 of 5
(205 Views)

Going to need to see the code on this one.  Posting the VI file is much better than posting screenshots.  Posting both is even better.

 

Also, how are you connecting to these?  GPIB?  Serial?  If serial, is it on a native port or via a USB adapter?

0 Kudos
Message 2 of 5
(172 Views)

This is a simplified version of my LabVIEW program. Let me briefly explain the setup: I’m trying to use a Keithley 2401 to measure voltages on different channels under the control of a DAQ6510 switch, with GPIB as the main communication interface.

The problem I’m encountering is that, after multiple successful measurements, at some random point, the Keithley 2401 fails to return a reading, which causes the program to hang and stop progressing. I am forced to manually press the stop button to abort the execution.

Download All
0 Kudos
Message 3 of 5
(146 Views)

This is a simplified version of my LabVIEW program. Let me briefly explain the setup: I’m trying to use a Keithley 2401 to measure voltages on different channels under the control of a DAQ6510 switch, with GPIB as the main communication interface.

The problem I’m encountering is that, after multiple successful measurements, at some random point, the Keithley 2401 fails to return a reading, which causes the program to hang and stop progressing. I am forced to manually press the stop button to abort the execution.

Download All
0 Kudos
Message 4 of 5
(144 Views)

This has the look of old code.  Not "2014" old, more like "1999" old.

 

I know you are using GPIB, but I would recommend using VISA nodes instead of GPIB nodes.  They're newer and much better in nearly all cases.  They would also allow you to easily change from GPIB to serial or Ethernet with almost no code changes needed.  When you get error messages out of them, the errors are also generally much better defined than the GPIB ones.

 

You're also not using any error handling... at all.  There is something called "automatic error handling", which is enabled by default and you don't seem to have turned it off, but whatever is causing your VI to lock up is clearly not triggering it. You didn't include any subVIs, and since the "lock up" is almost certainly happening in the 2401 subVI, I can't look at that more closely, but it's almost certainly not resolving nor throwing an error that gets displayed.

 

You're also using a stacked sequence structure.  This is widely considered a bad idea to use.  It's so bad that since 2018 or so, NI removed it from the palettes to discourage it from being used anymore (you can still create it but it takes extra work).  One of the main problems with it is that there is no way to stop it early without hard-stopping your entire VI.  This can be problematic especially when you have hardcoded "wait" instructions, like you do.

 

I would strongly advise you to do the following, in priority order:

1. Figure out how to get an error message of your 2401 read VI.  Maybe posting it here, maybe just adding error popups.

2. Remove that sequence structure and connect everything together with error wires.  Set it up so that an error stops everything, including skipping all "Wait" calls.

3. Replace the GPIB calls with VISA ones.

0 Kudos
Message 5 of 5
(111 Views)