Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing with cDAQ through Python NI-DAQMX Library from external PC

Hi, 

    I have a cDAQ-9132 system with a counter module and strain gauge module. These are connected to a semi-automated machine test bed that is controlled by an operator. Currently the cDAQ-9132 system runs a VI that samples one channel from the counter module and one channel from the strain gauge module and creates two shared variables. A desktop PC connected to the cDAQ-9132, runs a VI for an operator graphical-user-interface, and sees the shared variables to present the data in a live graph. 

 

   I would like to convert the entire system to Python (both the desktop PC and the cDAQ-9132). I have been reviewing the official NI Python DAQmx library and I believe it could fit my needs; however, I am confused as to which devices are supported. Basically, I would like to sample the cDAQ-9132 as if it was a regular DAQ from a Python script running on the desktop PC through the NI Python DAQmx library similar to this example. Is this possible? I have simulated the DAQ and tested this ability and it seems to work properly; however, I want to make sure my understanding is correct. I cannot test on the actual system currently as there is not any machine downtime for a few weeks.

 

   Currently, I have NI MAX 18.5 installed on the desktop PC as well as the cDAQ. I am using Python 3.11.2 and NI-DAQmx Python package version 0.7.0. Please see a full configuration below. Any advice or suggestions would be greatly appreciated.

 

*Edit: grammar

 

Configuration:

  • cDAQ-9132 with NI MAX 18.5
  • NI 9361 C Series Counter Input Module
  • NI 9237 C Series Strain/Bridge Input Module
  • Desktop PC with Windows 10, and NI MAX 18.5
0 Kudos
Message 1 of 2
(1,398 Views)

It is technically possible but not straightforward. cDAQ-9132 has its own controller thus you need to run the code on the target directly. Moreover, you must implement your communication protocol to transfer the data from cDAQ to PC.

If you don't want to run LabVIEW for whatever reason, I would recommend ni-grpc-device. Simply install the gRPC server on the cDAQ, then you can run the python gRPC client on the host PC.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 2 of 2
(1,373 Views)