Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Example how to route sample clock to an output terminal in C#?

Hello,

Is there an example in C# avaible how to route a sample clock to a PFI terminal?

I use PCIe6353 card and i want several tasks running with the same internal clock and i want to use the same clock for an external device. In de user manual of the DAQ X series is spoken that routing sample clock to output terminal is possible but not how.

 

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

Hey Leonderthaler,

 

I wasn't able to find an example but the NI-IMAQmx C Reference guide contains some useful information.

 

I am no C expert but this may help you out: http://zone.ni.com/reference/en-XX/help/370471AJ-01/mxcprop/attr0584/ 

 

Best, 

 

-Jelmer.

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

I think you want the ExportSignals class: http://zone.ni.com/reference/en-XX/help/370473J-01/ninetdaqmxfx40ref/html/allmembers_t_nationalinstr... . This class is accessible from an instance of the Task class (via the Task.ExportSignals property).

Daniel Dorroh
National Instruments
0 Kudos
Message 3 of 4
(2,398 Views)

Hello Daniel,

 

How do i use the ExportSignals property? 

 

This mine example code:

 

public class ClockTask
{
public ClockTask()
{
}

public void StartTask()
{
Task task = null;
try
{
task = new Task();
task.DIChannels.CreateChannel("/dev1/port0/line0", "", ChannelLineGrouping.OneChannelForEachLine);
task.Timing.ConfigureSampleClock(""
, 1000
, SampleClockActiveEdge.Rising
, SampleQuantityMode.FiniteSamples
, 1000
);

task.Control(TaskAction.Verify);
task.ExportSignals.SampleClockOutputTerminal = "/dev1/PFI4";

task.Start();
}
catch (DaqException daqException)
{
CloseTask(task);
}
}
}

privatevoid CloseTask(Task task)
{
if (task == null) { return; }
task.Dispose();
task = null;
}

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