Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequential Digital Outputs or Counters

I am trying to sequentially flash four digital outputs.  I want to run them at a frequency, with 25% duty cycle, one after the other.  To be clear, output one on for 25%, output two for 25-50%, output three for 50-75%, output four 75-100%, then repeat.  I tried using four counters, but they are not synchronized, so the pulses do not stay sequential.  I am using a USB-6143.  This seems really basic, but I am a pretty new user.

 

Thank you - 

0 Kudos
Message 1 of 3
(5,750 Views)

Hi,

 

You can use the output of one counter as the trigger for the task of the next counter. If you don’t know how to route the signal internally take a look to the next link.

https://www.ni.com/docs/en-US/bundle/ni-daqmx/page/internalchannels.html

 

Also, your tasks must be configured as retriggable, except the first.

0 Kudos
Message 2 of 3
(5,733 Views)

Assuming you are using the USB-6343 (there is no USB-6143, although there is a PCI variant), you can either run 4 counter output tasks with triggering and appropriate initial delays, or you can use a single digital output task with the appropriate waveform--for example, using lines 0:3 you could generate {1, 2, 4, 8, 1, 2, 4, 8 ...} to get the desired waveform.  The frequency of each output would be 1/4 of your sample rate (the sample rate is configurable).

 

Either method would work, but using digital output seems like a much more straightforward way to go about generating your signals.

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 3
(5,711 Views)