03-31-2017 05:06 AM
I am trying to generate two pulses of specified lengths synchronized with each other. I am trying to start the second counter with respect to the first one but I don't succeed. What am I doing wrong?
In this implementation I gen an error: Lines 4 through 7 of this port are configured for output. Cannot configure these lines for input at this time.
Can I use another source for synchronizing the two counters? Which one should I use?
Solved! Go to Solution.
04-03-2017 04:44 AM
You are trying to use a PFI-line as input and output at the same time, which is unfortunately not possible. The PFI-lines are arranged as ports (0-3 and 4-7) and you can configure them per port as either outputs or inputs (I guess you are using a 9401 digital I/O module?).
I wasn't able to find a way to route the trigger internally, so I would propose to route the signals externally:
Put a second wire (physically not LabVIEW) from the PFI5 to PFI0 and use the PFI0 on the trigger property node to read back the trigger pulse.
Andreas Jost
Applications Engineer
National Instruments
04-03-2017 04:58 AM
Tried this but I got an error:
Device cannot be configured for input or output because lines and/or terminals on this device are in use by another task or route. This operation requires temporarily reserving all lines and terminals for communication, which interferes with the other task or route.
If possible, use DAQmx Control Task to reserve all tasks that use this device before committing any tasks that use this device. Otherwise, uncommit or unreserve the other task or disconnect the other route before attempting to configure the device for input or output.
Device: cDAQ1Mod5
Digital Port: 0
Lines: 0, 6
I am not sure how should I use the DAQmx Control Task in this context.
04-03-2017 07:21 AM
Sorry my bad, I forgot completely about this peculiarity of the 9401.
In order to configure the 9401 correctly LabVIEW needs to know which in/outputs to expect before starting the first task. So you need to reserve the task which you start later using the DAQmx Control Task, as in the snippet below.
Andreas Jost
Applications Engineer
National Instruments
Ps: I am not sure if you are aware of it, but if you do not wire the low time inputs, LabVIEW will use the default value of the input instead which is 10ms.
04-10-2017 06:25 AM
Thank you Andreas, your solution works perfectly.