Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Repeat triggered DO sequence

I have an NI-6251 that I've set up to output a sequence of digital patterns based on an incoming trigger line (used as the "clock" signal). For example:

 

Input trigger 0: output line 0 set high

Input trigger 1: output line 0 set low, output line 1 set high

Input trigger 2: output line 0 set high, output line 1 set low

Input trigger 3: etc...

 

The problem I have right now is that I can't figure out how to tell the sequence to repeat itself. I can repeat the task a defined number of times by just writing these actions over and over again in the sequence, but if I end up with more triggers than there are entries in the sequence, then I get incorrect results. I only really need two actions in this sequence: one to set line 0 low and line 1 high, and the other to set line 0 high and line 1 low. Thus I want to generate a length-2 sequence and then tell the task to automatically repeat itself (so that after doing action 1, it resets its internal index and goes to action 0). Similarly, if I had a task with three separate lines that I wanted to individually toggle, then I'd only need 3 actions in the sequence if only I could figure out how to get the sequence to repeat.

 

Unfortunately I haven't managed that yet. I found the "Repeat Mode" property, which looks totally perfect except it's deprecated and not available. Surely there must be some non-deprecated equivalent?

0 Kudos
Message 1 of 2
(4,102 Views)

Figured this out. For future reference, the keyword here is "continuous"; if you search through the documentation thoroughly then you'll eventually stumble onto a page "Continuous Digital Output Programming Flowchart", which in turn points you to "DAQmxCfgTimingSampClk" (should be DAQmxCfgSampClkTiming, but whatever). And that method, which I was already calling, has a parameter to tell it if you want to generate a finite number of samples or an infinite number. I had it on finite. Stupid me.

0 Kudos
Message 2 of 2
(4,057 Views)