LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sweep voltage

Solved!
Go to solution

Hello i have to sweep the voltage between say(-5 volts to 5 volts) as such
between -5 to -2 at step size of 1, and between -2 and 2 at a step size of 0.5, and then at a step size of 1 beyond 2. 
the range -2 to 2 can change.(user input)
can anyone help me find a way to do that.

regards

Debi

0 Kudos
Message 1 of 21
(4,950 Views)

Create an array that has those steps defined.  Then feed that to the For Loop that contains your analog output function through an auto-indexing tunnel.

0 Kudos
Message 2 of 21
(4,933 Views)

Thanks, but can you send me a screenshot or an example to do this. As my sweep rate can always vary 

0 Kudos
Message 3 of 21
(4,907 Views)

Vary your sweep rate with a timer in the for loop.

0 Kudos
Message 4 of 21
(4,898 Views)

Hi Stuart,

 

how should a timer help when the sweep rate changes based on absolute value of the voltage?

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 21
(4,892 Views)

Hi Gerd,

 

Perhaps I misunderstood the OPs comment? I thought it was a query on how to vary the sweep rate (a time delay in the loop to vary the time between steps based on a user input is the obvious way).

 

I see now that perhaps the comment was raising the problem that varying the step size will vary the dv/dt if the loop speed is constant. If that is the case then the loop time would need to be calulated based on the step size taken from the array (assuming RavensFan solution).

 

Or have I missed something completely?

 

Stu.

0 Kudos
Message 6 of 21
(4,886 Views)

Hi All

Thanks for the replies. But I cant play around with time as well.
What I mean to ask is like if I have to sweep my voltage from -5 v to 5 volt at a specific sweep interval of 0.5 volts, but between a range (say -2v to 2 v, ) I want to sweep the voltge at lower sweep interval say 0.05 volts or even less.

Thanks again

Debi

0 Kudos
Message 7 of 21
(4,857 Views)

Hi Debi,

 

some pseudocode:

IF voltage => -2 AND voltage <=2 THEN
  step := 0.05
ELSE 
  step := 1
ENDIF
voltage := voltage + step

 Seems rather easy to program…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 21
(4,853 Views)

Thanks , but I have my vi like this. Can you have a look into that.

I can play with step sizes between -2v to 2 volts

 

0 Kudos
Message 9 of 21
(4,848 Views)

Hi debi,

 

well, you should learn about using statemachines - and DATAFLOW in general.

You use too many sequences and local variables!

 

And you need to change your "step size" according to your conditions. It will not work as long as you use a fixed value!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 21
(4,837 Views)