Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Gating Counter Channel Python

Go to solution


I am attempting to gate a counter channel that counts edges by using an input terminal. Essentially, I need it so that edges are only counted when that input terminal's signal is high. 

I did this by setting up a counter input channel which takes an input connected physically to a counter output so I can count pulses from it. That part works on its own. However, when I tried to set up the gating it gave me the error that:
" DaqError: Specified property is not supported by the device or is not applicable to the task"

Status Code: -200452

Property: DAQmx_CI_CountEdges_Gate_Enable


This is the property in question which seems to provide this functionality:


I am working on a NI PCIe-6384 device on Windows 10. I suspect perhaps the solution is not to enable gating on that channel. Could this be a working approach with a minor error is there some other method?


Here is my code:




def gen_and_collect(self, testlow, testhigh, ctr=0):
        # Testlow & Testhigh are used for the counter generation to create custom pulse lengths.

        #Defining output counter
        output_counter = nidaqmx.Task()

        # Defining counter for counting edges
        count_edge = nidaqmx.Task()
        ch = count_edge.ci_channels.add_ci_count_edges_chan(
        # These two lines cause it to error (setting up the gating)
        ch.ci_count_edges_gate_enable = True
        ch.ci_count_edges_gate_term = 'Dev1/port1/line7'

        # Counter for generation setup
        sw = nidaqmx.stream_writers.CounterWriter(output_counter.out_stream)
        sw.write_many_sample_pulse_time(testhigh, testlow)

        # Running






0 Kudos
Message 1 of 2
Accepted by topic author whiz.eram0

I don't know any of the Python syntax, but in LabVIEW calls to DAQmx functions this is typically done by configuring a "Pause Trigger" for the task instead of setting up "gating."


I don't know why it has to be done this way -- the gating config functions sure *look* like they should be available to do the same job.  But for whatever reason, DAQmx isn't allowing it.  Anyway, configuring a Pause Trigger will give you the behavior you want -- counting proceeds while the pause trigger terminal is in one digital state, it pauses when in the other state.



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).

Message 2 of 2