Hi everyone,
I've been asked to modify the frequency of a square wave generated using DAQ assistant whose output is wired to pin A0 of the NI-Elvis II board. The A0 pin is connected to the CTR0_OUT and the DAQ assistant is set to generate signals based on this counter output. The task says to modify the frequency of a 10 ms pulse train by wiring a numeric control to the input of the wait(ms) function.
I start by configuring my DAQ assistant as shown below:
![Screenshot (78).jpg Screenshot (78).jpg]()
And so I generate a square wave with a frequency of 50Hz (1/20ms) in the instrument launcher oscilloscope. This is simply done by having the DAQ assistant running in a while loop terminated with a stop button. Only now I don't know how to change the frequency of the pulse train with code simply using the wait (ms) function.I figured I must increase the width of the idle time by introducing a sizeable delay which I have tried.
At first I researched the wait(ms) function and found out that any code that it runs in parallel with will execute if it takes longer to execute than the delay value. If the DAQ assistant writes 100 samples at a rate of 1kHz that would mean a time between samples of 100 ms. I then figured that I would need to introduce a delay encompassing 100 samples which take 100 ms each (10,000 ms) As shown:
![Screenshot (79).png Screenshot (79).png]()
This is the best I was able to understand how the software might be working with the hardware. I thought I'd increase the delay to start the sampling of the signal from CTR0_OUT in increments of 10000 ms so to increase the idle time and hence increase or reduce the frequency of a pulse train with a duty cycle of 10ms.
This doesn't work and I still get a 50Hz square wave. If somebody could shed some light on this for me I'd greatly appreciate it, I have been researching this stuff for hours and can't seem to wrap my head around it. I now believe that a sample refers to both a high and a low pulse and not some arbitrary sample value on the period of the square wave at increasing increments in time but I still can't modify my signal in labview code.
Thanks,
Simon.