Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

signal generator

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?

0 Kudos
Message 1 of 11
(4,461 Views)

Run the error query function separately if it's not all ready being called.

0 Kudos
Message 2 of 11
(4,457 Views)

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.

Message 3 of 11
(4,422 Views)

 

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?

Download All
0 Kudos
Message 4 of 11
(4,398 Views)

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.

0 Kudos
Message 5 of 11
(4,393 Views)

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.

0 Kudos
Message 6 of 11
(4,391 Views)

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.

0 Kudos
Message 7 of 11
(4,362 Views)

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.

Message 8 of 11
(4,356 Views)

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.

0 Kudos
Message 9 of 11
(4,314 Views)

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.

0 Kudos
Message 10 of 11
(4,312 Views)