Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a value decrease by time, intervals of one second

Solved!
Go to solution

Hello I am working with an Agilent N5181A to send a command from my code. I have set up the frequency and now I want to be able to change the value for the amplitude. Right now I have a constant set to -30  and I want to replace it so that it goes from -30 to -80 in -10 intervals every second.

For example:

-30

-40

-50

etc

 

so that at the end I reach -80, I have attached a screenshot for better explanation, thanks.

 

 

LabVIEW Intermediate I level!
0 Kudos
Message 1 of 8
(7,987 Views)

Please stop posting to the wrong board. This is for NI Signal Generators - just like it says. Use the Instrument Control board.

 

Your question isn't even related to an instrument. All that you need is a shift register and a subtract function. Initialize the shift register to -30 and subtract 10 each loop. Stop the loop when the minimum value is reached. If your loop iterates once a second, that's all you have to do.

 

Message Edited by Dennis Knutson on 10-27-2009 03:13 PM
Message 2 of 8
(7,980 Views)

How do I connect this to the Agilent PSG MXG Series Configure Power.vi? from where to I take the output to the input of the power.vi?

 

Also is the control STOP supposed to be a random one? 

 

LabVIEW Intermediate I level!
0 Kudos
Message 3 of 8
(7,963 Views)

The x-y value would be your amplitude setting. Your existing code would have to be placed inside a loop likethis.

 

Of course the stop is not 'random'. The loop stops when the final value is reached.

 

Why don't you simply create a VI like this to get an idea of how it works. It's very, very basic LabVIEW programming.

 

 

Message 4 of 8
(7,958 Views)

If I  place the whole code inside the loop doesn't this affect the frequency that I am setting up?

 

the Stop control do you get it from right clicking on the loop? since it does not seem to be working correctly when I run it, it just stays on -40.

 

 

 

 

LabVIEW Intermediate I level!
0 Kudos
Message 5 of 8
(7,954 Views)

I am not an expert that is why I am asking

 

but if I just want to change the value for the constant, (the one attached and enclosed in red) do I need to set the while loop for the whole code?

 

LabVIEW Intermediate I level!
0 Kudos
Message 6 of 8
(7,953 Views)
Solution
Accepted by topic author Bebeto

The frequency setting is whatever you pass to the frequency control value. How often you update the voltage is dependent on the wait time. You said you wanted intervals of 1 second. That's why I used 1000 msec in the example. Obviously you would not need to put the whole code in the loop. Just the voltage function and whatever else that you need (i.e. some measurement).

 

The stop control is a control. If you do not know how to create a control on the front panel, you might want to go back to the very basic LabVIEW tutorials and review them.

 

The stop value is whatever you want. You said you wanted to have the values decrease from -30 to -80. If that is what you want, use a value of -80 in the control. If you want to stop at -90, enter that.

Message 7 of 8
(7,945 Views)
thanks for the explanation
LabVIEW Intermediate I level!
0 Kudos
Message 8 of 8
(7,939 Views)