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: 

Problem with control the signal generator??

I use State Machine to control the signal generatorAgilent 33522A.

My ideal is setting a period time of 0~20ms can be adjust and can also adjust the voltageAmplitudewith each indicate time.picture below

My problem is the signal generator have some noiselike the sound of relayand can’t catch on with the value which I have set.

 

33522A_con_2.JPG33522A_con.JPG

0 Kudos
Message 1 of 3
(3,280 Views)

You are trying to create a step function by supplying a new voltage point every 20-60ms? And you see noise or spikes on each step?

 

First you shouldn't need the Enable.vi in every loop, you only need to call it once after you configure your waveform in order to enable the relay at the instrument output.  Then disable or turn it off (F) using the same VI at the end of your code.    This however should not be causing noise as the relay shouldn't flip from T/F/T every time but stay T...AFAIK.  

 

But I think your bigger problem is abusing that configure waveform VI.  The way you are doing it now, every loop you re-configure everything about the waveform which is actually giving the instrument 10-20 commands (resetting all the settings you had already made) just to adjust the voltage.  I suspect somewhere in that long string of commands it sets the amplitude to 0V, then eventually gets around to setting to the value you specify causing a short spike.  Rather than using that Configure VI  all you really need to do is send the SCPI command  ":SOUR: VOLT <voltage>;" to specify a new amplitude.

 

However, even that's not the recommended way to do things with a waveform generator.  Don't have your code do the timing, have the instrument do it.  You should build a waveform file, with multiple points at each voltage step, then specify the sampling rate, then let the instrument internally make the steps at the right time.  It should be able to prevent almost all the overshoot/noise at each step since it reads ahead and can anticipate range changes.  Implementing this method will be much more flexible if you ever need to speed things up to a step that is too fast for windows to handle.  It also presents delays on the PC end from causing delays in your waveform.  (20ms is not always 20ms with windows.  It could be 20ms 9/10 times and 100ms the 10th!)  

 

Look at the examples for building and reading ARB waveforms, and implement one for your step function.

 

Best of luck,

Craig

0 Kudos
Message 2 of 3
(3,216 Views)

Thanks for your response.

But I still have some problem with your suggestion.

First, I want to adjust the time and voltage manually.

231651.jpg

Just like the panel below (My professor give me as reference)

 SAMPLE.JPG

Second, I’ve test the code you recommend to me.

I’m new to labview , could you tell me more specific about instruction.

Should I start from the code below?

33522A_con_3.JPG

0 Kudos
Message 3 of 3
(2,729 Views)