LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop that controls RG generator

Solved!
Go to solution

This might be a stupid question which is very easy to achieve in C++.

 

I searched for 20 pages and couldn't figure out how to solve it.

 

Basically we want to start from some point (200MHz), take 10MHz as a step, end at some point(300MHz).

 

First it output a 200 MHz signal for 10(variable) seconds, then output a 210 MHz signal for 10 seconds, then output a 220 MHz signal for 10 seconds, blablabla.

 

Thus we need a variable that initialize itself at the beginning, add "step" at each iteration. 

 

However, I can't find a variable (That can store value) in LabView that can help me to do this.

 

The Array in LabView can store value, yet it is quite awkward to use array. 

 

The C++ function (somehow) looks like this.

 

cin >> startpoint >> step >> endpoint;

 

cin >>duration;

 

a=startpoint;

b=step;

c=endpoint;

d=duration;

 

for (i = 0; i< (c-a)/b; i++)

{

RFoutput(a);

Wait(d);

a=a+step;

}

 

Is there anyway to use LabView to realize this?

 

This might seems stupid, but I am stuck for a pretty long time!

 

Thank you very much!

 

 

 

0 Kudos
Message 1 of 3
(3,031 Views)
Solution
Accepted by topic author PbZhang

If you think arrays are awkward to use, you need to start with a few basic LabVIEW tutorials before attempting a simple program.

 

In any case, look into shift registers to maintain state between loop iterations. You could also create an array ramp covering your values and then autoindex at a FOR loop boudanriy. There is even a function called "ramp pattern".

 

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

Finally I found ramp pattern is very handy. Thanks!

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