07-24-2025 03:21 AM
Dear community,
I am not used to National Instrument devices, so this question may be obvious.
I am using a compactRIO 9056 device with two NI-9223 modules connected on it in oder to measure voltages signals in real time.
I am trying to read the analog input channels of the modules with python using the niDAQmx library with the python code attached to this post. However, I keep getting the following error message :
DaqError: Device identifier is invalid.
Device Specified: cRIO1
Suggested Device(s): SimDev1
Task Name: _unnamedTask<5>
Status Code: -200220
However, I can see my device with NI-MAX, and it succeeds all the tests I can do with it. I can even define a task on NI-MAX and take some data. (see ni-max window)
I don't understand what I am doing wrong with my python code. Is the device compatible with the NI-DAQmx library ?
The NI-DAQmx Device Drive version I used is 2025-Q2 patch 1. And the python library version is 1.0.2.
Thank you for you help,
Solved! Go to Solution.
07-24-2025 04:47 AM
NI MAX accesses the resources on the cRIO through remote session. However, you cannot do the same with Python. There are two ways to use python with cRIO:
07-30-2025 02:54 AM
Dear Zyong,
Thank you for your answer. I did install miniconda directly on my cRIO device, and run my python script on it, and it works.
Just a detail that was not mentioned in the tutorial. By default, the LANG environment variable is set to L1 (I don't know why.), and the nidaqmx library require an UTF-8 encoding. So I should set the LANG variable value before running my python script by running the command:
export LANG=en_US.UTF-8
I wrote this command in the .bashrc file of my cRIO so I don't have to run it each time I want to connect to my device.
Thanks for your help.