12-16-2021 08:42 AM
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
Solved! Go to Solution.
12-16-2021 11:59 AM
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
12-20-2021 02:59 AM
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.