From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
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)

 

Requirements

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).

 

Implementation

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:

 

LucaMarella_0-1664488760440.png

 

The Python intepreter shows this message:

LucaMarella_1-1664489034532.png

 

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:

LucaMarella_2-1664489484251.png

 

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: 

LucaMarella_3-1664489796463.png

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.

LM

0 Kudos
Message 1 of 2
(840 Views)

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.

Santhosh
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
(815 Views)