Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating User Defined Square Wave

Hi All,

I am trying to generate a user defined analog square wave voltage output. I am using MyDAQ and I was able to do it with Simulate Signal feature of Labview but I am not able to control the signal as I want to. I am playing with frequency and duty cycle to control the signal there. So I need to build a vi which allows me to input the width of the pulse and the pause duration between the pulses within a certain time period, i.e. say there will be 2 pulses with 0.3 s pulse duration and 0.2 s pause duration between the two in 1 s.

Do you know how I can modify the attached vi in onder to achive this?

Thanks,

SC

0 Kudos
Message 1 of 2
(3,407 Views)

You can create an array with the transition times and output levels. Then use the autoindexing feature of loops to go through the array. If the signal is periodic (at the 1 second rate for example), nested loops may be appropriate. You would create a single cycle in the array. The inner loop would generate that signal. The outer loop would repeat the inner loop.

 

I presume you are aware that software timing is dependent on the vagaries of the OS. If your minimum time interval is ~0.1 s, then you will generally be OK. There may be some jitter and on rare occasions the OS may delay longer than that.  The reads in your 10 ms loop will experience quite a bit of timing jitter. I do not know what the myDAQ capabilities are but if it has the capability, setting it to sample continuously at 100 Hz and then read all available samples ~10 times per second may work better.

 

Lynn

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