Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

export sample or reference clock in C#

Solved!
Go to solution

Hello,

 

I am looking for a way to export the reference clock for a particular device or sample clock for a particular task to one of the PFI lines on my m-series device. I am programming in C#. I saw methods such as 

 

DAQmxConnectTerms

 

and

 

DAQmxExportSignal

 

for the C API, but no corresponding methods for C#. According to the 6259 m-series manual, I should be able to at least export a sample clock to a PFI line, if not the actual reference clock. Thanks.

 

-Jon

0 Kudos
Message 1 of 5
(4,167 Views)

Hello Jon,

 

There are, in fact, equivalent calls in C#.  You can find more information about them in Visual Studio's Object Browser under National Instruments.DAQmx >> ExportSignals.  A screenshot of this is found below.  Hope this helps!

 

Export.PNG

 

Regards,

Joe s.

0 Kudos
Message 2 of 5
(4,161 Views)

Thanks Joe, that is very promising.

 

My problem now is that I don't know how to use this method. Reading the object explorer and  the NI-DAQmx .NET Framework 3.5 Help explore provided little insight. Specifically, I declare an ExportSignals object like so:

 

internal ExportSignals exSig;

 

later I try to make an instance of this object

 

exSig = new Exportsignals();

 

However, I get an error saying that ExportSignals has no constructor. It does not seem like ExportSignal is a static method of ExportSignals because I need to at least declare exSig before I get references to the ExportSignal method in intellisense.

 

Do you have a code example in which this class is used correctly? Thanks!

 

-Jon

0 Kudos
Message 3 of 5
(4,152 Views)
Solution
Accepted by topic author neuronerd

Jon,

 

After a bit more research, I've found a method that might be even better for your application.  In the DaqSystem class, there is a method called "ConnectTerminals" that lets you specify signals to connect together.  The syntax will be similar to this:

 

DaqSystem.Local.ConnectTerminals("/Dev1/Ctr0InternalOutput", "/Dev1/PFI1");

 

You can find documentation on this in the Object Browser under NationalInstruments.Daqmx.DaqSystem.  Let me know how this one might work for you.

 

Regards,

Joe S.

0 Kudos
Message 4 of 5
(4,148 Views)

Yes Joe, that did what I needed. Thank you very much.

 

- Jon

0 Kudos
Message 5 of 5
(4,135 Views)