Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Specifying timing device with cDAQ 9178 and NI 9201 module in python

Hello.  I am trying to perform a delayed analog input measurement using a cDAQ 9178 and NI-9201 analog input module.  I am tryiung to port code running on an NI-4363 but am running into an error:

 

det_task.ai_channels.add_ai_voltage_chan(self.detector_channel)
det_task.timing.cfg_samp_clk_timing(rate=ACQ_RATE, source = 'PFI1',
                                                            samps_per_chan=samples,
                                                            active_edge=Edge.FALLING)
det_task.timing.delay_from_samp_clk_delay = peak_delay
 
When I run this, I get the following error on the last line:
 
inidaqmx.errors.DaqError: DAQmx Timing property specified requires per device configuration. Explicitly specify the device(s) to which this property should apply. Property: DAQmx_DelayFromSampClk_Delay
 
It seems pretty clear that I need to set the active device, but I have no idea how to do this.  I found this thread (https://forums.ni.com/t5/Multifunction-DAQ/DAQmx-Timing-property-specified-requires-per-device/td-p/...) where it looks like it can be done in LabView, but I'm not really sure how to do it in python.  Any suggestions on how to set this in python?
 

 

 

0 Kudos
Message 1 of 1
(811 Views)