LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse generation digital output

Hello,
 
Attached is a VI I managed to create, that send a digital pulse everytime a waveform crosses zero. I would also like to output this waveform on an ao line. I tried several ways and the timing always does not work. And another thing the VI attached now only runs for a few seconds then stops generating the waveform or digital pulse. Any ideas how to output the waveform on an ao line at the same time the DO outputs a pulse?
 
0 Kudos
Message 1 of 6
(3,166 Views)
The reason that you stop getting data after a while is the way you are indexing the array. When the value of i exceeds the length of the array you will get default values (0). Use the quotient and remainder function.

Also equality comparisons on non-integer numerics are not a good idea as the internal binary representation of the numbers can cause slight differences. A greater than zero comparison followed by AND or equality of the boolean result with the previous boolean is a better zero crossing detector. If your real signal is noisy, you may need to do additional processing to avoid problems with noise near zero.

Right to left signal flow makes diagrams much easier to understand.

Lynn
0 Kudos
Message 2 of 6
(3,154 Views)
Hello,

I've attached a VI that demonstrates the calculation of a pulse train based on a SINE wave. It uses the zero-crossing VI mentioned above.

I hope this helps you in creating the AO pulse signal.

Regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 6
(3,148 Views)

Hello Lynn,

I cannot run the file I get a bunch of error, attached, but I get the idea, here is another solution attached which will do what i need but using an ao instead of a do. I want to send a trigger with a relative phase to an ao. Attached is my unelegant solution but it works

 

Thank you for your help

Download All
0 Kudos
Message 4 of 6
(3,148 Views)
Those warnings will not prevent the program from running. They are a result of the tricks I have to play to load DAQmx VIs on my Macintosh. I used the diagram disable function to disable all the DAQ stuff so I could run the sine generator and the zero crossing detector. Just remove the Diagram Disable blocks and you should have a working progrma including the DAQ again.

Lynn
0 Kudos
Message 5 of 6
(3,146 Views)

Hello Everyone,

 

Attached is my solution, its in express but it works

 

 

Ala

0 Kudos
Message 6 of 6
(3,133 Views)