Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Use counter lines for DIO

Solved!
Go to solution

Hi

 

I am using PCIe-6612 and PCI-6601.

 

I use both counters and DIO simultaneously.

 

My question is if I can use counter lines (such as OUT and Gate) as DIO if they are not specifically used in the counter that is setup?

 

I use NI-DAQMX C called from a C# application.

 

Example A:

I use ctr0 for monitoring a linear encoder where the value is simply polled from the counter. Thus Gate (PFI 38) is not used and OUT (PFI 36) is not used and not configured.

Is there a way to release the unused lines so that they can be configured as digital output/input lines, while the counter is running?

The counter is setup with DAQmxCreateCILinEncoderChan

 

Example B:

Here the counter is used as a pulse generator and thus only OUT is used. The remaining 3 PFI channels are not used and should therefore be useable for DIO - but they are not accessible while the counter task is running.

This counter is setup with DAQmxCreateCOPulseChanFreq + DAQmxCfgImplicitTiming

0 Kudos
Message 1 of 3
(1,474 Views)
Solution
Accepted by topic author Simon_DK

I would not expect you to have this problem.  I'm solely a LabVIEW guy and don't personally know the C syntax for DAQmx, but I did use the similar PCI-6602 device quite a bit in years past.  My recollection is that it was quite flexible in accomodating such signal routing, even allowing the same terminal to be used in both a counter task AND a DIO task, provided at least one of the tasks used it as an input signal.

 

Have you tried configuring and starting the DI/DO tasks *before* configuring the counter tasks?  Are you sure the DI/DO tasks only configure individual lines and aren't trying to configure the entire port?

 

Please post the code related to setting up and starting your DAQmx tasks -- that will improve the odds of getting relevant help.  Also let us know the exact error you get and where it occurs.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 3
(1,455 Views)

Hi Kevin

 

Thanks for your reply!

 

I have looked closer into this and it does seem like all the lines not specifically configured for a counter are free to use for DIO.

 

My problem was that I set up a digital output line and later configuring a CO task that by default used the same pin as a DO task.

This was easily solved by changing the CO "out" to a different line.

0 Kudos
Message 3 of 3
(1,425 Views)