08-19-2011 07:38 AM
I use a CompactDAQ 9178 with module 9401
I'd like to read n samples from the digital input when it detects the first change on the input signal.
I wrote to do this attached vi.
Unfortunately, when I'm trying to run it stops with an error message:
Error -89137 occurred at DAQmx Start Task.vi:2
Possible reason(s):
Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: cDAQ1
Source Terminal: di/SampleClockTimebase
Required Resources in Use by
Task Name: _unnamedTask<AF>
Source Device: cDAQ1
Source Terminal: ChangeDetectionEvent
Destination Device: cDAQ1
Destination Terminal: di/SampleClock
- Where I made a mistake?
- How else solve this (seemingly simple) problem?
08-22-2011 06:19 AM
Hi,
the problem is that you want to use the digital line you are sampling as a trigger source as well. DAQmx will reserve the line for one purpose and for the other you won't be able to use it. You will have to choose another digital input as a trigger source, and make an internal connection between your signal input and this other input, this way you will be able to use triggering and sample the same signal.
You can make the connection with the DAQmx Connect Terminals VI (Measurement I/O -> NI-DAQmx -> Advanced -> Signal Routing palette.)
Be very careful though, because making wrong connections (for example connecting two outputs) can physically break your DAQ device!
How Can I Know What Internal Routes are Available on My Device?
http://digital.ni.com/public.nsf/websearch/E539D226A643C1CE8625715E007C23C8?OpenDocument
Regards,
Daniel
08-23-2011 04:02 AM - edited 08-23-2011 04:06 AM
Hello Daniel,
Thank you for suggestion, it makes sense.
Unfortunately, I’ve got another problem.
Simple diagram defining route path:
raise error:
Error -201133 occurred at DAQmx Connect Terminals.vi:3
Possible reason(s):
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: cDAQ1Mod6
DigitalPort: 0
I have checked possible route path on my device (is available) and tried to reset device immediately before running mentioned vi – no effects.
Maybe you have another suggestion?
Regards
Arek
08-23-2011 06:20 AM
Hello Arek,
as you can see, the DAQmx Connect Terminals VI can't do its job if any of the terminals is reserved by a task. This means that you will have to do the connecting first, and after that you can create the virtual channels you want to use and do the acquisition itself. You can achieve this with a Flat Sequence structure, or a more elegant solution would be to use the error line to determine the order of execution. Just connect the error out terminal of the DAQmx Connect Terminals VI to the error in terminals of both Create Virtual Channel VIs in your project.
Best regards,
Daniel
08-23-2011 06:44 AM
Daniel,
Did you mean:
Unfortunately it still doesn't work - the same error message.
Regards
Arek