10-27-2010 09:25 PM
I am using Tektronix AFG 3011 signal generator to get the signal of various frequencies. I used the AFG 3011 instrument driver VI to control the amplitude and frequency. I set some frequencies and the generator generated and displays the frquency I set. I am wondering how do we know that it is generating the correct frequency signal if I cant check looking at the generator display. Is there any kind of response or acknowledgement that is received from the generator to verify this?
10-27-2010 10:57 PM
Run the error query function separately if it's not all ready being called.
10-28-2010 10:08 PM
Once you send a configure command to set the frequency or other parameters, you can use the correspond query command to query the instrument whether the parameters have been set into it. Check the instrument manual for the query command format.
10-29-2010 10:22 PM
I used the VISA write and read to query the instrument and verify the parameters I set in LAbview to control the generator are correct . It did return correct reponses twice. But I get an error while tryiing to run it again. Is there any separate VISA read and write for USB interface? Could it be the cause of error?
10-29-2010 10:51 PM
There are no separate VISA functions for USBTMC instruments and your error has nothing to do with GPIB, either. See that the error is coming from the scan from string? Do NOT place the write and read in parallel with your close from the driver. Having 2 close functions is just not necessary anyway. Learn to do things sequentially with a single instrument.
Why do you even feel its necessary to read back what you have just programmed? Do you suspect a bug in the driver? The query is useful when you are debugging a driver but other than that, its usually just a waste of time.
10-29-2010 11:04 PM
p.s. If you would look at the code for the functions in the driver, you would see the error query being called. So, if the instrument received an invalid command, it would report that. Personally, once I verify the driver works, I usually remove all of these as they just add to the programming time. I like to control when and if to query for errors.
10-30-2010 07:29 PM
Thanks. Yes, it worked when I edited the VI so that the read and write VIs are not in parallel to the close VI. I am using Labview driver Vis to control the frequency and amplitude of a signal.
I used query that inquires its current frequency and read back instruments response just to verify that the frequency is the same I set using driver VI.
The Error query VI in the driver reeads errors in the instrument but I dont know how to verify that the controlled parameters for the signal generator using Labview driver and the parameter values dispalyed in the instrument are same incase there is an error.
10-30-2010 09:30 PM
You already know that the command syntax in the driver is correct. You've verified that the instrument will change frequncy per the command by looking at the front panel and doing a readback. So about the only error that you can get is if you send a command for a frequency that is out of range. The error query will report that. If you turn off the instrument or disconnect the cable, you will get a VISA/GPIB error. What else is bothering you? In a different thread, you complained about how long your code is taking. How do you justify adding more time? Are you really planning on doing a readback after every command you send? That is not a common practice.
11-01-2010 09:28 PM
I dont think doing readback for each frequency is a goodway either. Is there any other way to verify that for a given frequency , the instrumment receive the data and process correctly.
11-01-2010 09:41 PM
I don't know why you want to do so. Actually the driver (if downloaded from NI IDNET) you are using is certified and has been verified. If you are really concern about the actual data the instrument is using, you can check the command with the support engineer from the manufacture.