From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing output amplitude on Agilent function generator while output is on

Solved!
Go to solution

Hello,

 

I am trying to write a program to sweep amplitudes of a sine wave output from a function generator (Agilent 33210a). I have two example driver sets: Agilent 33xxx and HP33120a (the first one uses VISA, 2nd uses IVI). 

 

Using the sample code from the drivers, I modified them to generate a sine wave at 1Vpp, wait 1s, then change the amplitude to 0.5V. I've attached images from my scope that show what happens when I do this. Both examples first turn off the output before turning it back on with a different amplitude. The 33xxx driver takes 140ms to change, and has a strange burst signal in between. The HP3120a driver takes 30ms and looks cleaner.

 

Using Agilent 33xxx example:

Agilent 33xxx Drivers.PNGscope_11.png\

 

Using HP33120a Example:

Agilent HP33120a Drivers.PNG

scope_10.png

 

I'd like to have the change be instantaneous. When using the generator manually, I can turn the knob and change the output in real time without delays.

0 Kudos
Message 1 of 7
(5,302 Views)

First of all, that wait seems really weird to me.  Comparing the tick count to 1000 you wait seems dangerous to me.  All you really need is a sequence structure with the wait inside, pass the error cluster through the sequence structure to make sure you wait the 1 second at the right time.

 

What is inside of the VIs that set the amplitude?  It is likely they turn off the output and turn it back on.  You will need to rewrite this part of the driver (keep it in your project library and leave the actual driver alone) if this is how it works.  Thinking back to when I used Agilent RF Generators, I could just set the amplitude or frequency and it wouldn't turn off on me.  So it would have to be part of the driver code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 7
(5,296 Views)

Thanks for the input. With some more tinkering, I've discovered 2 things.

 

1. The function generator has internal switches that are activated as the amplitude increases/decreases past certain thresholds. I'm guessing there are different sets of internal amplifiers/buffers that need to be switched based on the desired output voltage.

-- The switch always gives a glitch signal. To avoid this, I decreased the output range of the function generator so as not to activate the switch

 

2. After doing this, the IVI drivers (HP33120a) did not turn off the output before decreasing the voltage. The signal looks like an exponential decay to the new value. This is what I wanted 🙂

 

Here is what the code and signal output look like now:

Agilent HP33120a Drivers2.PNG

1.png

 

However, the VISA drivers (Agilent 33xxx) still has the output turned off for ~100ms before adjusting the output to the new value. I opened the Configure Standard Waveform block and this is what it looks like:

Agilent 33xxx Configure Output.PNG

 

It will be tough for me to adjust this one. I have the programming guide for the generator, and I understand the idea of the command string that is fed to it, but tinkering around with this might be a waste of time for me since the IVI drivers work ok.

 

Can the VISA driver be fixed easily? I would also need to add a setting for adjusting the output impedance of the generator, which is not configured in this example, but is in the IVI one. Here is what the Configure Standard Waveform block of that one looks like by the way.

 

HP33210a Configure Output.PNG

 

 

Thanks for the help answering my questions. I still have a lot to learn about LabVIEW and any suggestions/comments are welcome.

 - John

0 Kudos
Message 3 of 7
(5,266 Views)

fixed last post...

0 Kudos
Message 4 of 7
(5,261 Views)

I am using the same Agilent at my lab =).

I had a lot of work to learn somethings about it, like softwere triggering and how to set Hi/LoLevel instead the Vpp.

 

I don't know what you are doing with it and I don't know if you will have any delay between changes.

But one thing you can do is use Event Structure. With it you can leave de output on and change the waveform, amplitude, frequency, etc... on the Front Panel as you want and it will change "at the same time" on the Agilent.

Message 5 of 7
(5,254 Views)

I'm guessing the changing of the waveform shape causes the dropout.  Glad to hear you got it working though.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(5,236 Views)
Solution
Accepted by topic author jto2

Thanks for the suggestion Mateus, but I am trying to automate this process as best I can. Altering the VISA driver is the direction I'd like to go.

 

Thanks also crossrulz... I wrote a new VI based on the Configure Standard Waveform VI so that it just writes the new amplitude command, and none of the other stuff. Worked like a charm! Now the waveform changes amplitude without turning off the output. I checked also to see if re-setting the waveform to sine wave (even though the original is also sine) was the cause of the delay as you suggested, and you were right. Thanks for the help!

 

Agilent 33xxx Configure Output NEW.PNG

 

 

0 Kudos
Message 7 of 7
(5,221 Views)