Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6602 edge counting with pause trigger has resource conflict

Solved!
Go to solution

I have a customer with a PCI-6602 counter device. He's trying to use our software to set up several counters for unbuffered edge counting with a pause trigger (that's NI-speak for "gate") so that he can control when the counters count. He wants to assign arbitrary PFI's to the counter sources and gates.

 

My code (abbreviated- rather complicated code):

 

DAQmxCreateCICountEdgesChan(GetTaskHandle(), getChannelName().c_str(), NULL, edge, initialCount, dir)

DAQmxSetCICountEdgesTerm(GetTaskHandle(), getChannelName().c_str(), SourcePin.c_str());

DAQmxSetPauseTrigType(h, DAQmx_Val_DigLvl)

DAQmxSetDigLvlPauseTrigSrc(h, triggerSrc.c_str())

int32 trigger_level = edgeslopewhen ? DAQmx_Val_High : DAQmx_Val_Low;

DAQmxSetDigLvlPauseTrigWhen(h, trigger_level))

 

In his set-up this works fine for four counters, but the fifth gives an error -89137 when the task is started (or committed). Here is some debugging output that shows the connections he wants to make, and the resulting error information:

 

  dev: Dev4, srcTerm: /Dev4/PFI12, gat: /Dev4/PFI20, ctrNum: 0

  dev: Dev4, srcTerm: /Dev4/PFI13, gat: /Dev4/PFI21, ctrNum: 1

  dev: Dev4, srcTerm: /Dev4/PFI14, gat: /Dev4/PFI22, ctrNum: 2 

  dev: Dev4, srcTerm: /Dev4/PFI15, gat: /Dev4/PFI23, ctrNum: 3

  dev: Dev4, srcTerm: /Dev4/PFI8, gat: /Dev4/PFI16, ctrNum: 4 

  NI-DAQmx driver error while calling function DAQmxStartTask; device Dev4:-89137: Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Extended info:Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: DAQmx_CI_CountEdges_Term 

Property: DAQmx_CI_CountEdges_ActiveEdge

Source Device: Dev4

Source Terminal: PFI8

Required Resources in Use by

Task Name: Dev4_CTR_4

Source Device: Dev4

Source Terminal: PFI16

Destination Device: Dev4

Destination Terminal: Ctr4Gate

Task Name: Dev4_CTR_4

Status Code: -89137

 

Seems like the PFI's were never assigned to anything, so they should be available. Is there a default assignment? Do I need to disconnect something in order to connect it to the gate/source?

 

My apologies for the long and complicated posting; I couldn't figure out a simpler way to post it while including all the necessary info. Any help very much appreciated.

 

Windows Vista

NI-DAQmx 9.3.0f2

PCI-6602

 

 

John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
Message 1 of 5
(3,103 Views)

Hi John, 

 

It appears the issue is that the route of PFI8 to Ctr4 Source uses TIO/Internalline8 to route the signal which PFI16 to Ctr4 Gate uses as well.  You can change the terminal from PFI8 to "Ctr7InternalOutput" and the error should go away as this terminal does not utilize the same line.  Let me know if that works for you, and/or if you have any further questions.  

Regards,

Ben N.
Applications Engineering
ni.com/support
0 Kudos
Message 2 of 5
(3,084 Views)

Thanks, Ben. That explains the error. Unfortunately, the customer simply wants a bunch of independent counters, each with a gate. So he needs to come up with compatible pairs of PFI's to use for source/gate pairs.

 

How would I find out about the conflict in the internal route, except by trial-and-error? The MAX Device Routes table for the 6602 device show all PFI-to-CtrNSource and PFI-to-CtrNGate routes as being direct routes.

John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 3 of 5
(3,079 Views)
Solution
Accepted by WM_John_Weeks

John -

 

I assume you are familiar with Device Routes which can be tab-selected in MAX for a particular device.  In that table of routes you will see white (blank), yellow and green boxes tiled throughout the matrix of the device's terminals.  The blank is a no-route, yellow is indirect and green is direct.  It's running into the indirect routes that is going to cause a potential resource use issue.  If you hover your mouse cursor over the Yellow or Green box on the Device Route Chart, you can Shift+Click and it will popup the internal device route.  

 

In your customer's instance, PFI 8 and PFI 16 were both using Internal line 8 for the indirect route to both the Ctr4 Source and Gate respectively.  

 

 

Regards,

Ben N.
Applications Engineering
ni.com/support
Message 4 of 5
(3,076 Views)

Ah, thanks Ben. I was missing the shift-click part.

 

What I see in MAX is that the blocks connecting PFI's to counter source/gate are all green, but the shift-click information shows that the internal routes use something called TIO0/InternalLineN. Indeed the routes for PFI8 and 16 both use InternalLine0.

John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 5 of 5
(3,074 Views)