Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Read multiple counter in c# aplication

How can I read multiple counter in my buffered aplication write in c#. I use 6601 and 6602 devices. When I try readeng all counter in my alication, I can read just two counter ( one from 6601 device and one from 6602 device). Thanks in advance for the help,
Otto
0 Kudos
Message 1 of 6
(4,546 Views)
Hi Otto-

You should be able to read from multiple counters easily. You will need to group each counter into a seperate task if you want to run them concurrently. I have attached a C# example that shows how to count buffered digital pulses on one counter with an external clock. This should give you a starting point to modify for multiple counters.

I hope this helps!

Thanks-
Tom W
National Instruments
0 Kudos
Message 2 of 6
(4,525 Views)
Hi Tome.
When I triying use two counter concurrently I give this message:

No DMA channels are available.
Either shut down other tasks that might be using these channels or consider changing your data transfer mechanism to Interrupts.
Device: Dev2
Task Name: ciTask
Status cod: -200251

See my cod in attachment.

Otto.
0 Kudos
Message 3 of 6
(4,513 Views)
Hi Otto-

I have been able to run your app successfully on my system. Everything seems well-designed and structured, so I would suggest that you try it on a different system. Make sure that you're not running any other hardware operations at the same time, and remove any other PCI cards from the system if possible.

I hope this helps!

Thanks-
Tom W
National Instruments
0 Kudos
Message 4 of 6
(4,487 Views)
Hi Tom

How can I change the default source pin in main counter aplication?

Otto
0 Kudos
Message 5 of 6
(4,470 Views)

Hi Otto-

The counter pins can be changed by a variety of options as described in the DAQmx C Reference Help (Start>>Programs>>National Instruments>>NI-DAQmx).  For a count edges input task the relevant property is "DAQmxSetCICountEdgesTerm(TaskHandle taskHandle, const char channel[], const char *data);"

I hope this helps!

Tom W
National Instruments
0 Kudos
Message 6 of 6
(4,456 Views)