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.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple DO on cDAQ with separate timebases

I am coding this currently using a 9278 chassis with a 9401 module.  I have a customer who will be using the code on a 9172 with a9472

 

Currently the code is set up to do a regenerating DO pulse generation on lines 0-3 using counter 0 as the timebase.

 

I want to do the same thing for DOs 4 and 5, but with counter1 running at a different speed.

 

(And then use software to set lines 6 and 7).

 

Can this be done?

 

I set up a parallel task for the second hardare timed DO routine, and it works when the first task is not running.  When I run the 4-ch task first, I get the error below.

Is this saying that there is only one DO Sample clock for the entire chassis?  Is this true for both the 9172 and 9178?

 

Is there any way to do this (multiple DOs with multiple hardware clocks?

 

Error -89137 occurred at DAQmx Write (Digital 2D U8 NChan NSamp).vi:1

Possible reason(s):

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: cDAQ3
Source Terminal: Ctr1InternalOutput

Required Resources in Use by
Task Name: _unnamedTask<AB>
Source Device: cDAQ3
Source Terminal: Ctr0InternalOutput
Destination Device: cDAQ3
Destination Terminal: do/SampleClock

Task Name: _unnamedTask<AE>

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

Ah.  1 DO timing engine.  Gotcha.  I confused that with the 3 engines for AI.

 

I also noticed that you cannot have multiple DO tasks that use the same timing source, even if it's already configured.  this may complicate things a bit for me...

 

Maybe someone has a suggestion for this...

 

DO channels 0-3 are controlling heaters.  Currently set up for PWM output, 1 Hz DutyCycle 0-100.  I am doing this with CTR0 as the timebase, using regenerating output and continous samples.

 

DO channels 4-7 are controlling valves.  I am using channels 6,7 to set the direction (software controlled output) and channels 4-5 produce a pulse train (each pulse moves the valve).  I coded up a routine that used non-regenerating output and finite samples to send a single pulse train on demand.

 

The valve control really needs to be hardware timed, so I suppose I could software time the heater controllers (it's a PID, and it's slow repsonse, so that might work) but it would be nice if I could use the same timing engine and send regenerating pulse trains to 0-3 and finite pulse trains to 4,5.

 

Any ideas?

 

Jed

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

Would it be possible to implement both as continuous non-regenerating tasks?  For the lines that you wanted to regenerate, you would just have to manually feed in the same data, and for the other lines, just send all zeros in between the finite pulse trains. 

 

-Christina

0 Kudos
Message 3 of 5
(3,507 Views)

Hi Jed,

 

Did you ever figure this out?  I am trying to solve the exact same issue right now!

 

Thanks

Matt

0 Kudos
Message 4 of 5
(3,023 Views)

It's been a while, but I think what I had to do was temporarily suspend (or kill) the first task to run the second for a short time, then re-enable the first.  Not ideal

0 Kudos
Message 5 of 5
(3,013 Views)