Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing two counters on cDAQ-9172

Solved!
Go to solution

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? 

0 Kudos
Message 1 of 5
(2,979 Views)

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

Andreas
CLA, CTA
0 Kudos
Message 2 of 5
(2,934 Views)

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. 

0 Kudos
Message 3 of 5
(2,931 Views)
Solution
Accepted by topic author owieccc

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.

 

synchronize 9172.png

 

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.

Andreas
CLA, CTA
Message 4 of 5
(2,924 Views)

Thank you Andreas, your solution works perfectly. 

0 Kudos
Message 5 of 5
(2,886 Views)