Hello everyone ! I am new with the nidaqmx python package and acquisition measurement devices and have some problems to set a specific external sampling clock for the acquisition of data (NI cDAQ-9185 chassis with NI 9775 device).
Until now, I have used the internal clock of my DAQ in order to configure the acquisition of the data for my three voltage channels and everything works without problem. In order to improve the setup, I tried to add on the 4-th channel a pulsed voltage signal with non-periodical behavior and try to define it as the new sampling clock for the data measurement. The goal is that the DAQ only acquires data on the three other channel when the 4-th channel detects a rising edge and stop after a certain number of data, which is known. The tricky part is that the pulsed signal begins when the script is launched and the number of pulses is known, but not the duration of the signal. For that, I used a simple python script like :
Each time I run the script, I end up with an error like :
I have also try to replace the task_1.timing.cfg_samp_clk_timing(...) function with :
to define everything manually but end up with the same error.
But trying to look a bit in the documentation, I have found that it is normally possible to define a method like this one (using a specific pulsed signal as a sampling clock) but didn't find any answer for my problem. Does anybody have an idea if this method is possible and how to implement it in python ?
As I am new in the domain, it is clearly possible (a without contest probable) that I have made an error in the understanding of the package, or just miss something. So don't be afraid if something seem completely strange !
Thanks everybody for the future answer !
- Adrien