04-26-2011 03:23 PM
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
Solved! Go to Solution.
04-27-2011 11:19 AM
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!
Regards,
Joe s.
04-27-2011 06:56 PM
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
04-28-2011 12:26 PM
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.
05-01-2011 10:02 PM
Yes Joe, that did what I needed. Thank you very much.
- Jon