Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

M Series: How to trigger correlated digital output?

I have been searching around without finding a solution, so I hope somebody here can help me!

I plan do to correlated digital output on an M series board (6229). This article explains that CDO is possible by means of a timer of another subsystem or an external source.

I would like to develop a system that behaves like:
1. A counter serves as the master trigger.
2. A digital output task is triggered by the counter (rising edge)

My .NET C# code contains:
---
Task SuperTask = new Task("SuperTask");
SuperTask.COChannels.CreatePulseChannelFrequency("Dev2/ctr0", "SuperTrigger",COPulseFrequencyUnits.Hertz,COPulseIdleState.Low,0,1000,0.1);
// no trigger, started by run()
SuperTask.Triggers.StartTrigger.ConfigureNone();
SuperTask.Control(TaskAction.Verify);

Task SubTaskDO = new Task ("SubTaskDO");
SubTaskDO.DOChannels.CreateChannel("Dev2/port0/line0:7", "DigiOutTask",ChannelLineGrouping.OneChannelForAllLines);
// triggering is not possible. use a "correlated clock" of another subsystem
// timing: correlated clock=Dev2/ai/SampleClock, 1 kHz, 500 samples
SubTaskDO.Timing.ConfigureSampleClock("/Dev2/ai/SampleClock",1000,SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 500);
SubTaskDO.Control(TaskAction.Verify);
---

The question is: how can I make the ctr0 trigger /Dev2/ai/SampleClock? Or in which other way can I use ctr0 as a trigger for correlated digital output?

Thanks in advance!

Cz.
0 Kudos
Message 1 of 5
(4,243 Views)
hello cz,

just to get the application right:
you want to generate a clock with CTR0. as soon as this counter starts to generate it should be the timebase for the digital output?

regards,

robert h
NI germany
0 Kudos
Message 2 of 5
(4,232 Views)
Robert,

I would like to trigger several output tasks (AO, DO) by a counter (ctr0). The output tasks should send a finite sample to the target device.

AFAIK, triggering AO is no problem.

Triggering DO requires a sample clock of another subsystem or an external signal (right?). I would like to use ai/SampleClock since I do not use AI in this system. Is this possible? Is the DIO triggering concept meant like that? How can I setup a start trigger ctr0->ai/Sampleclock without using a AI channel?

Thanks!

Cz.
0 Kudos
Message 3 of 5
(4,229 Views)
hello cz,

you will have to configure the analog input in any way. you don't have to use the data, but in order to start the clock you need to configure it.
when this is done, you could use the AI sample clock as clock for the digital output. if you configure the analog input as a triggered acquisition, it will start also the digital output, when the trigger event occurs.

regards,

robert
0 Kudos
Message 4 of 5
(4,218 Views)
Ok, I see the point - I will try that.

Thanks a lot!
0 Kudos
Message 5 of 5
(4,215 Views)