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: 

generate a square wave using gen voltage update.vi

Hi,

 

I am trying to generate an analog voltage in my PCIe 6363 card using the power_test.vi (similar to gen voltage update.vi). However, if i put the VI in a loop to time the voltage output, using time delay or wait (ms), the oscilloscope output is very unstable and is jumping. Meaning, the output doesn't follow the specified timing consistently.

 

Here is an example. I want to generate a square wave(power_test_v1.vi) by using a while loop with time delay or 10 ms for 10 V in the input of the gen power_test.vi then another time delay of 1 ms for 0 V input of the power_test.vi using a while loop. How can i make the oscilloscope output consistent and stable, just like the result when I used a DAQ assistant ang generating a continuous sample square wave.

 

I am attaching my simple codes.

 

Your help is much appreciated. Thank you.

Download All
0 Kudos
Message 1 of 6
(2,638 Views)
A software timed output is never going to be precise unless you switch to a real time os. There is simply to much jitter on Windows. Try creating a waveform array with all of your samples. For example, specify a sample rate of 1ms. The first 10 samples are 10 volts. The next sample is 0 volts.
0 Kudos
Message 2 of 6
(2,630 Views)

Hi Dennis,

 

Thank you for your response. However, I cannot do a waveform array since I need to have another VI running on that speficied time, like the 10 ms window. 

 

What do you mean by a real time OS?

 

Thank you.

 

0 Kudos
Message 3 of 6
(2,622 Views)
A real time os is an operating system with deterministic timing, unlike Windows, Mac, Linux. Purchase LabVIEW Real-Time.

Your statement about another VI does not make much sense to me.

Live with the jitter inherent with Windows, use hardware timing, switch your os, switch to fpga.
0 Kudos
Message 4 of 6
(2,616 Views)

Hi Dennis,

 

I want to use the analog output to control a driver for power control, and this is a part of a main vi that is use to control the positioners, read a certain text file, etc. And most of this functions take less than a ms to shift from one sub vi to another. That is why, I made this test to see if the power control is stable and how long is the lag time so that we can program accordingly. However, we are stuck in this dilemma of a jittery, unstable result when we try to loop the power control.

 

Thank you.

0 Kudos
Message 5 of 6
(2,611 Views)
I believe that this sort of application would be better on real time or fpga (ie a cRIO).
0 Kudos
Message 6 of 6
(2,608 Views)