Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Using DAQ-MX to read pulse width from PXIe-6612 on Ubuntu

$
0
0

My code is producing this error, even though my sample rate is only 20Hz and the time source being used is the onboard 10MHz clock:

 

nidaqmx.errors.DaqReadError: Multiple Sample Clock pulses were detected within one period of the input signal. Use a Sample Clock rate that is slower than the input signal. If you are using an external Sample Clock, ensure that clock signal is within the jitter and voltage level specifications and without glitches.

 

import nidaqmx import nidaqmx.system from nidaqmx.constants import AcquisitionType if __name__ == "__main__": device = "COUNTER_TIMER_1" channel = "ctr0" system = nidaqmx.system.System.local() for device_name in system.devices: print(device_name) pulse_width = nidaqmx.Task() pulse_width.ci_channels.add_ci_pulse_width_chan(f"{device}/{channel}") pulse_width.timing.cfg_samp_clk_timing(rate=20, source="PXI_CLK10", sample_mode=AcquisitionType.CONTINUOUS) #pulse_width.timing.cfg_implicit_timing() print(f"pulse_width us: {pulse_width.read()}") pulse_width.close()

 

The card worked correctly using the same setup on Windows. On Windows, I was able to use timing.cfg_implicit_timing() instead of cfg_sampl_clk_timing(). NI-DAQMX also requires a timing source to be defined when using Ubuntu


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>