Real-Time Measurement and Control

Showing results for 
Search instead for 
Did you mean: 

Python DAQMX - how to trigger a logging using NI 9237 module

Dear all,

I'm facing a problem with a Python DAQMX application using cDAQ and NI 9237 module (C series, 4 channel analogical input, strain/Bridge).


Hardware configuration

This is the hardware configuration:

n. 1 - cDAQ - NI 9189 - 8 slot

n. 4 - NI 9237 module - 4 channel (for a total of 16 channel)



The Python application has to configure a task for acquiring and logging - in TDMS file - all the 16 analog input channels; this task should start when at least one of the 16 analog signals crosses a specified level (for example: 10 Volt/Volt).



The following snippet shows my first attempt of "start_trigger" declaration for the "task_log". 

It's an example using only the first channel of the first NI 9237 module:




The Python intepreter shows this message:



So it seems not allowed to use this kind of trigger (cfg_anlg_edge_start_trigwith strain/bridge analog channel. And I had the confirmation from NI-MAX trigger configuration of NI-9237, as shown in the following:



In other word, with NI 9237 module you must use only a "digital edge trigger" and the famous PFI (Programmable Function Interface).


So the snippet becomes this one: 


PLEASE: do not forget to write '/cDAQ2/PFI0'; if you write 'cDAQ2/PFI0' - without the first slash - IT DOESN'T COMPILE.


And that's the problem: in my field installation there is no wired connection to the PFI0 (the cDAQ onboard Programmable Function Interface).


And so, which is the best approach to obtain "a software trigger" to start acquiring and storing TDMS file when one of channels crosses the level?

I guess there is something I've to better understand: thank in advance for your help and suggestions.


Best regards.


0 Kudos
Message 1 of 2

Since you confirmed that there is no hardware feature of analog trigger, you can implement your own trigger structure in your application layer, you've to continuously capture samples in your application, and monitor the sample values, once it crosses your trigger threshold, now start storing the subsequent samples.

Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 2