I am currently in the process of writing a LABVIEW VI in order to interface with an Agilent U2722A. I want to measure current continually while increasing voltage from 0V to a use defined maximum specifiying the step size and time step (a linear voltage sweep).
I have downloaded the applicable driver for this device which also inculdes an example used to output a voltage and then take measurments. My first problem is that when I run this VI the device times out. I think this problem MAY have something to do with the "triggered level" input. Which is being passed to the Configure Voltage Channel VI. I have included both the example and the Configure Voltage Channel Sub VI.
My lack of understanding for the other SubVIs (which are based off of SCPI commands being passed through VISA as strings) is also preventing me from making any progress. Particularly the configure sweep and configure trigger VIs.
Confgiure sweep takes in values for the number of points and the timestep. I am not sure how I am supposed to make use of this VI. Should I set this to the desired values and then use a loop to pass different values to the configure voltage channel with each iteration. Also, how is the timestep being measured? Do I need to configure a trigger to measure time between points or does the sweep function take care of that? I have included both the configure sweep VI and the Timestep VI as well.
Solved! Go to Solution.
Please make sure that you have Context Help enabled in the LabVIEW development environment (Ctrl + h), and then hover over the controls and VIs to get more information about them. In most cases, the example should be able to run sucessfully with the default values, so please tell me more about the timeout issue that you are seeing. Also, please take an NI-Spy capture of the timeout occuring and post the .spy file.
If the context help information for the VIs and controls is not enough, please see if the instrument's manual has the information. Let us know what you find out and if you have anymore questions.
I have already tried using context help and this provides very little details. If you open up these sub VI's you can see the SCPI command being written to the device. I have already consulted the agilent programmers reference guide included with the device and this did not provide much insight either.
When I try and open the NI-spy I get an error message that it is unable to located the DLL for my API and reccomends that I reinstall national instruments software for this API.
It seems that my problem in running the example VI occurs in the initialize VI when making use of the Clear VISA command. The error message is:
Error -1073807360 occurred at VISA Clear in Agilent U2722.lvlib:Initialize.vi->Agilent U2722 - DC Power Output DC Volts.vi. Possible reason(s):
VISA: (Hex 0xBFFF0000) Unknown system error (miscellaneous error).
It seems that an IO error occured at a very early point in the initialize VI. Could you confirm whether the "VISA Open" VI returned successfully? You can do that by running the VI in debug mode and place a probe on its error out terminal.
NI-Spy can be very useful. I recommend that you download and install the November Device Driver DVD which will upgrade you to the current version of NI-VISA, NI-MAX, and NI-Spy. Hopefully that will fix the NI-Spy issue.
I started the download for NI-SPY update, but that will take a while to dowload.
How do you run a VI in debug mode? I did a search in help and couldnt find any clear reference. When you say probe do you mean the error handler VI?
I have managed to get almost all aspects of this software working. Everything works fine the first time I run. The second time I will get an error message and have to turn of the device close the VI and then re-enable both and it will work fine. (I would still like to fix this problem)
The first time I run the software it works how I want it to. If I try and run it a second time I get the following message:
Error -1074000000 occurred at Agilent U2722.lvlib:Error Query.vi
Possible Reasons: Instrument reports:-420,"Query UNTERMINATED"+0,"No error"
Complete call chain: Agilent U2722.lvlib:Error Query.vi, Agilent U2722.lvlib:Close.vi, Agilent U2722.lvlib:Initialize.vi
It will alternate between working fine and giving me this error message. If I disconect the power to the device and reconnect
between sweeps it will also work fine.
Also, I am having some doubts as to the timing of my measurments. Currently, I have a while loop generating all of the required points in my voltage sweep. Inside this loop I pass those voltages as they are generated to my set Voltage sub VI which links to my measure voltage and current sub VI. Inside the while loop is a wait timer set to wait 100ms between iterations. Is there a more accurate method of doing this?
Looks like that you got another error related with instrument IO. Here is some reference for this error,
-420, "Query UNTERMINATED" --------------------------
This error occurs when you addess the instrument to talk and it has nothing to say.
The most likely causes are:
1. Not sending a query. You must send a valid query to the instrument before addressing it to talk. This is true even of measuring instruments, such as the Model 2001. You cannot get a reading from the 2001 until you send it a query.
2. Sending an invalid query. If you have sent a query and still get this error, make sure that the instrument is processing the query without error. For example, sending an ill-formed query which generates an error -113, "Undefined header" and then addressing the instrument to talk will generate an error -420, "Query UNTERMINATED" as well.
3. Valid query following an invalid command.
Currently I dont have an instrumetn in hand so I can't figure out what exactly what the problem is, but would you mind pasting your code so we can look into it together?
The most accurate method is absolutely the one provided by hardware itself. Here it is "Interval" in Configure Sweep.vi.