Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting data using Python

Hello,

I am attempting to collect data from a cRIO-9048 that has a NI 9234 in its first slot. I would like to use the NI-DAQmx Python API to interface with the hardware. After installation of the NI-daqmx package and drivers I wanted to do a simple test, where I collected data from one accelerometer, so I used some sample code I found that you can also see below.

 

import nidaqmx

with nidaqmx.task.Task(new_task_name = "test") as task:

        task.ai_channels.add_ai_voltage_chan("Dev1/ai0")

 

When I run the code I get the following error:

DaqError: Device identifier is invalid.

Device Specified: Dev1

 

I checked some other resources and the solutions given were to make sure that the device identifier I am calling has the same identifier in the NI Max window. I have double checked it to make sure I am using the correct identifier, but I still can’t resolve this issue. I have also found a basic example on the Github page, which I have attached to this post. The example code does not seem to be very different from what I am trying to do, yet when recreated it does not work. I have also attached a screenshot of the NI Max window. Thank you for your help in advance.

0 Kudos
Message 1 of 4
(2,547 Views)

Hello there!

 

Could you tell us the OS you are using and its version? I'd like to know better about the programming environment you are using. 

Also, could you generate a MAX technical report for your computer and the cRIO? use this document to generate the report. Generate the report in the cRIO by right-clicking the cRIO and selecting report.

We could use these reports to check the versions of the drivers and software in both systems to understand if there is any discrepancies or incompatibilities.

0 Kudos
Message 2 of 4
(2,520 Views)

Hello, 

 

Thank you for the reply. The OS I am using is Windows 10. I have created the reports and attached them to this post. 

 

Thanks

Maxwell

Download All
0 Kudos
Message 3 of 4
(2,515 Views)

Just another thought. I would like to confirm that NI-DAQmx Python API (https://nidaqmx-python.readthedocs.io/en/latest/index.html) is compatible with the device (cRIO-9048) I am using. 

 

Thanks,

Maxwell

 

0 Kudos
Message 4 of 4
(2,512 Views)