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: 

Output sum of two waveforms on counter output

Hi all,

 

In order to control a light source I am using two counters to generate a PWM TTL level signal on one counter where frequency (10Hz-99999Hz) and duty cycle (0-100%) can be changed on the fly. On another counter I generate a 5000Hz 1us PWM signal that is fixed in freq/duty cycle. The two signals are combined in an external OR gate and sent to the device. The fixed signal can be turned off if needed. I have seen a bunch of advanced triggering and waveform generation stuff that is possible with Labview. So, the above must be possible using one counter output without the need for any external gates. Timing is important so I need to avoid stopping/starting tasks repeatedly as that causes unacceptable delays. Can someone give some pointers on how to do this. I have a NI USB-6210 available. I am using Labview 2016. I was wondering if I can maybe use the Build digital waveform block somehow, how would I send the resulting waveform to the counter?

 

Arne

0 Kudos
Message 1 of 2
(2,356 Views)

No, yours is the best way.

Counter operates not in waveforms, but in pulses. Generate pulses at specified frequence, depending on external condition. Gating = pause trigger, it is kind of AND, but only for the start of the pulse, it will not interrupt pulse that already has started.

It can generate patterns of pulses of variable width, theoretically you can describe your OR-ed digital waveform as a sequence of pulses. But you will need to constantly update this buffer of pulses while generating - much more CPU load, programming and increased time to reflect parameter change. Also 6210 does not support buffered counter generation.

Also theoretically you could use buffered digital output and continuously generate and update this waveform. But the same reasons as above: more calculations and 6210 does not support it.

Message 2 of 2
(2,316 Views)