Dear all,
I am learning how to use the nidaq device with python.
we have USB 6210 and python module nidaqmx.
we want to use USB 6210 as counter.
i made python code below.
###################################
import nidaqmx
counter = nidaqmx.Task()
rate = 100000
co1 = counter.co_channels.add_co_pulse_chan_freq(
counter = "Dev2/ctr0",
units = FrequencyUnits.HZ,
freq = rate)
# if terminal is selected, daq is not working.
co1.co_pulse_term = "Dev2/PFI7"
counter.start()
######################################
when terminal is not selected, counter is output from PFI4.
please help me if you know how to select.
actually, i made program for checking the bhavior this problem.
###################################
import nidaqmx
counter = nidaqmx.Task()
rate = 100000
co1 = counter.co_channels.add_co_pulse_chan_freq(
counter = "Dev2/ctr0",
units = FrequencyUnits.HZ,
freq = rate)
counter.start()
with nidaqmx.Task() as counter1:
rate = 50000
co1 = counter1.co_channels.add_co_pulse_chan_freq(
counter = "Dev2/ctr0",
freq = rate)
co1.co_pulse_term = "Dev2/PFI7"
counter1.start()
h = input("ok ? >>")
######################################
In this case, i can select terminal in next task.
if i write terminal in frist task, error is shown.
Property: DAQmx_CO_Pulse_Term
Destination Device: Dev2
Destination Terminal: Dev2/PFI7
Channel Name: Dev2/ctr0
please help me if you have solution.
best regards