Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing PCIe-6351 in C#

As the title suggests, I'm writing a controller in C# with the aim to read counts using a PCIe-6351. Right now, all I'm asking my code to do is display the counter readout starting from a value of 10 ever 200ms about 10 times.

But my readout is returning this

0: System.Collections.Generic.List'1[System.Double]

... repeated to index 9.

 

My initialization code is as follows:

public Task ReaderTask { get; private set; }

public void AddReadChannel(string channelName, bool isCounter)

{

     string cname = new String(channeName.Where(Char.IsLetter).ToArray());

     {

          this.ReaderTask.CIChannels.CreateCountEdgesChannel(channelName,

          "Counterreader " + cname, CICountEdgesActiveEdge.Rising, 10,

          CICountEdgesCountDirection.Up);

     }

}

I have two issues I'm trying to resolve on my own, but could use help wtih

1. Finding the method to configure the input terminal to PFI0 from the default PFI8. When I connect to the terminal in NIMAX I see counts being received when I switch to that terminal.

I was also curious if anyone could inform me if I should work using the single channel reader or the multi? 

 

Any help would be so greatly appreciated.

 

0 Kudos
Message 1 of 2
(2,875 Views)

Could you please go through the following tutorial on configuring your DAQ device using a text based programming language.

Using NI-DAQmx in Text Based Programming Environments - http://www.ni.com/tutorial/5409/en/

 

After reading through this, let me know what questions you have or what issues you run into.

 

Also take a look at this for the return type you are getting:

https://stackoverflow.com/questions/16106181/c-sharp-system-collections-generic-list1system-string

0 Kudos
Message 2 of 2
(2,838 Views)