Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6602: semi-period measurement error: -89137

Hi,

I'm trying to accurately start the semi-period counting on rising edges on all 8 counters of the NI 6602.

I'm using the following code (task loading not shown):

        for ( int i = 0; i < 8; ++i)
        {
            ...

            ret = DAQmxGetCISemiPeriodTerm( handles[i], "CI", name, sizeof( name));
            CLEAR_ON_FAILED( ret)
            ret = DAQmxSetDigEdgeArmStartTrigSrc( handles[i], name);
            CLEAR_ON_FAILED( ret);
            ret = DAQmxSetArmStartTrigType( handles[i], DAQmx_Val_DigEdge);
            CLEAR_ON_FAILED( ret)
            ret = DAQmxSetDigEdgeArmStartTrigEdge( handles[i], DAQmx_Val_Rising);
            CLEAR_ON_FAILED( ret)
            ret = DAQmxSetCISemiPeriodStartingEdge( handles[i], "CI", DAQmx_Val_Falling);
            CLEAR_ON_FAILED( ret)
        }

All calls succeed but when I try to start the tasks, the 7th and 8th task can't be started due to the error:

#define DAQmxErrorResourcesInUseForRoute_Routing (-89137)

It works as long as I only configure and active 6 counters. The counters could be counter 0-5, 1-6, 2-8 or another mixture just using 6 counter.

Is it possible that only 6 counters may be configured with an "arm start trigger" connected to the counter input?

Best regards,
Michael
0 Kudos
Message 1 of 6
(5,075 Views)
Hey Michael,
 
It sounds like you also tried running the 8 counters without arm start trigger, did it work?
 
Christian
0 Kudos
Message 2 of 6
(5,054 Views)
Hi Christian,

yes it's possible to start all 8 counter tasks without the "arm start" trigger. It's also possible to start 6 counters with the "arm start" trigger AND the remaining 2 counters without. Of course I get the "first sample is not valid"-problem on the counters started without the "arm start" trigger and I'd like to have all 8 counters running with only valid samples in their buffers.

The code I use to accomplish this is more or less the same as described here:

http://digital.ni.com/public.nsf/allkb/47BAA9569AEDFC0886257091007A217A

Any idea why this doesn't work for the last two counters (of the 8 counters used)?

Best regards,
Michael
0 Kudos
Message 3 of 6
(5,049 Views)
Hey Michael,
 
Sorry for my late response but we are still working on this problem. This issue had been reported before, but there is no solution yet.
 
Thanks,
Christian
0 Kudos
Message 4 of 6
(5,020 Views)
Hi Christian,

thank you for your response. If you could reproduce the problem too, I'm no longer afraid that I've made something wrong.

Please let me know if a workaround or solution is available.

Thank you  & best regards,
Michael
0 Kudos
Message 5 of 6
(5,008 Views)

Hey Michael,

Sorry for late response, but I was out of office (actually I'm still out of office).

Are you using a single trigger line for triggering the counters or are you using separat trigger lines for each counter? Also, is this a PCI card or a PXI module?  This will make a difference because the PXI chassis have 6 built in trigger lines so it is possible that if you are trying to use that 7th line, which is reserved for the 10MHz clock, you will get the resource reserved error.  The RTSI for PCI have 7 available trigger lines.

You can send a single trigger on a single trigger line and have all the different counters use that trigger line to start their task.  Basically you just have to set all the counters to trigger off of one PFI line.  Hopefully this is the issue that you are seeing.  If it is not, then we will need more information.
One thing that would be good to check is what route you are using and make sure that that is ok in MAX.  In the code you are using, it looks like you are using the same name for each, but I don't know if you are changing the name of the trigger line somewhere else in the while loop.

Thanks, Christian

 

 

0 Kudos
Message 6 of 6
(4,781 Views)