LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I correctly time while loops using SCPI and VISA/Ethernet communication to send DC current Values to a Power supply?

I'm rather new to using labview and I having an issue with a test Data Aquisition lab I'm trying to setup using a Keithley 6221 AC/DC current source and a basic PCI M-series NI-DAQmx.  First of all, I'm looking to update the  current value on a power supply at a rate of atleast 10Hz and I'm using SCPI commands and VISA communication through ethernet to do so.  Attached below is the VI I have written. 

The issue I'm having is this:
    My VI will loop through the values fine in software, or so it seems.  I am unable to get the Power supply to update sequentially if I don't set my loop delay to anything greater than 130ms.  If I try to run the loop faster it starts skipping values instead of counting 1,2,3,4,5,1,2,...etc.  it goes 1,2,4,5,2,4,1,2 on the display of the power supply and my DAQ unit also skips these values so I know that the number just isn't getting read to the Power supply in time.  I was wondering if this was due to my sloppy programming or if it is a hardware issue, my computer or the method of communication to the power supply?  Is this due to the fact that I'm using ethernet and VISA communication?  Is there a faster way to communicate or is GPIB faster?  Any input at all would be extremely helpful.

On a side note:  Right now I'm using an pre-determined array of values that I can update on the fly but in the future this with be put into a  closed-loop control system.  The value for the power supply output will be determined by the loop and sent that way.
0 Kudos
Message 1 of 4
(4,097 Views)
How fast can the power supply update? I am not familiar with that equipment, but 130 ms does not seem out of line. Many GPIB instruments take that long or longer to update. If the instrument ever needs to change rnages between successive values, the delay might be longer. I am using a Keithley electrometer which updates in 360 or 720 ms, depending on range.

I don't use the DAQ Assistant so I am not sure how it behaves. Parallel loops need to have a wait function in each loop to allow LV's internal scheduler to share CPU resources between the loops. Try adding a Wait(ms) function in the DAQ loop with the wait value = 0.

Lynn
0 Kudos
Message 2 of 4
(4,092 Views)
Also, one of the string constants is NOT set to '\' Codes Display. Here is an alternative method of calculating the index. I removed the DAQ and VISA stuff since I could not run it.

Lynn
0 Kudos
Message 3 of 4
(4,087 Views)
Thanks for you helpful responses I completely missed that the one string was not in '\' coded. I'm getting in contact with Keithley tomorrow to see what the repsonse time of their DC source is.  If that's the case I might have try to approach the coming control problem differently.  Using interpolation/ Moving averages/buffering or something to gain extra data points, but this is just me brainstorming.  Again, I appreciate the quick repsonse.
 
-Bryan
0 Kudos
Message 4 of 4
(4,082 Views)