Since the error was relating to errorquery.vi I removed all of these from my VI. After I did this I got a new error message which pointed me to a visa read in my initalize VI. I realized that the only query here was the IDN command used in the ID query. I deactivated ID query and everything appears to be working fine now. No more error messages.
As for the configure sweep command I cannot use this because it is only linked to the voltage or current array measurements. Since only one measurement array command can be issued at a time I would not be able to measure both voltage and current as I am applying votlages.
Finally, there is no VI (or device command) that will allow me to apply a series of voltages in time with the sweep. I must issue commands for each voltage I want to apply. The only way to ensure that voltage and current measurements are taken immediatly after the applied votlage is to request single current and voltage measurements immediatly after the voltage is applied.
I have issued a wait command inside a loop for the amount of time required to achieve the desired scan rate (set by the user). If I store the value of the timer at each iteration of the loop the elapsed time between iterations is exactly what it should be. Obviously there is a limit to how fast the loop can execute (56ms) but this value is small enough that it shouldnt be a problem I dont think.
I have read carefully your post, I can see that the LabVIEW code you are using is similar than the one I need.
I have downloaded the Labview example to control U2722A USB modular source measure unit. The structure of my program consists of Initialization, Configure Channel, enable Configure Output, Read Output (Single), unable Configure Output and finally Close. Using Configure Channel in current mode, I want to apply a current (positive or negative) to a capacitor while I am measuring the charging/discharging voltage. However, I don’t know the reason when I set 1 mA in the input called Current Range, the current oscillates between -1mA and 1mA, and it is not constant. Since I set a voltage limit of 2 V, the indicator of Read Output (single) shows 2 V, however, I am not able to apply different currents to the capacitor, that is, I can only limit the voltage but not change the polarity of the value of the current source, then I can not obtain an output voltage of 2 or -2 V when I apply a driving current of 1 or -1 mA, respectively. Could you please help me to use in a proper way the example: Agilent U2722 – DC power output DC Volts Labview.
Summarizing I need to:
I hope I have explained the problem I observed clearly.
Thanks in advance for your help.