Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

9361 pause trigger using PFI0

Solved!
Go to solution

Hi all!

 

My question is straightforward I guess, but I cannot find a suitable C# .NET example for the following situation.

I have a CompactDAQ 9178 with an 8 counter module 9361. I want to program or route the global PFI0 from the CompactDAQ to gate some(!) of the counters of the 9361. So, when PFI = high, counters (i.e. 1,2,7,8) should be active and counting. PFI = low, counters should be paused. Other counters should be active all the time.

 

I have the following test code. Later on I want to split the counters into gated/ungated counters.

 

for (int i = 0; i < this.countCounters; i++)
{
counterName = string.Format(@"{0}", this.cinList[i]);
counterReadTaskGated.CIChannels.CreateCountEdgesChanne(counterName, "", CICountEdgesActiveEdge.Falling, 0, CICountEdgesCountDirection.Up);
counterReadTaskGated.CIChannels[i].CountEdgesTerminalConfiguration = CICountEdgesTerminalConfiguration.Rse;
counterReadTaskGated.CIChannels[i].CountEdgesGatePauseState = CICountEdgesGatePauseState.Low;
counterReadTaskGated.CIChannels[i].CountEdgesGateTerminal = "/cDAQ1/PFI0";
counterReadTaskGated.CIChannels[i].CountEdgesGateEnable = true;
}

 

Getting the error:

 

"Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

 

Property: NationalInstruments.DAQmx.CIChannel.CountEdgesGateTerminal

Corresponding Value: /cDAQ1/PFI0

 

Channel Name: cDAQ1Mod4/ctr0

Task Name: _unnamedTask<23>

 

Status Code: -200077"

 

 

Any help is appreciated and thanks in advance!

 

Martin

0 Kudos
Message 1 of 4
(4,977 Views)
Solution
Accepted by MVW

I do not see the way to route it or the manual info that says it can be possible.

cDAQ routing is very limited, it is much simpler than PXI with built in RTSI. Chassis has its own counters and 9361 module counters are separate. You can access chassis counters (and _possibly_ trigger input) using digital I/O module (9401, 9402) that do not have their own counters.

0 Kudos
Message 2 of 4
(4,894 Views)

Hello Martin, 

 

What you are trying to do is feasible but you will have to make a trade-off between using the PFI pins on the NI 9361, or the ability to pause specific counters and only pause the acquisition. If you wish to pause specific counters based on the lines of code you have posted you should change "cDAQ1/PFI0" to cDAQ1/9361modulename/PFIx. Where the PFIx is the PFI line on the 9361 you will connect the pause signal to.

 

If all the NI 9361's PFI pins are in use then you can use a pause trigger and point it at the "cDAQ/PFI0" pin. This is a different function call that is needed. This page has a list of C functions http://zone.ni.com/reference/en-XX/help/370471AE-01/cdaqmxsupp/ni9361/ and the ones of interest to you are the pause trigger functions. This function pauses the acquisition's of all the counters on the module. Also, when the pause trigger is deasserted the read will return the current count and not continue from the paused count. 

 

Regards, 

 

Izzy O. 

Product Support Engineer 

National Instruments 

ni.com/support

0 Kudos
Message 3 of 4
(4,808 Views)

In fact, not a solution for my problem, but it is correct. After some research and a telephone call with NI, It became clear to me that the 9361 has indeed no backplane fascility. The only way to get gating working is to use the PFI's of the module itselve. An expensive counter input is lost....

Thanks for your response. 

 

0 Kudos
Message 4 of 4
(4,740 Views)