Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Read scaled units from NIDAQmx task with python

How can I read scaled units (e.g. mbar) from tasks definied in NIDAQmx with Phython nidaqmx?

I can only access signal names and values from defined tasks (using: nidaqmx.task). I can also access defined scalings and their units (using: nidaqmx.scale). But I can't find the connection between these informations.

0 Kudos
Message 1 of 3
(2,678 Views)

Hi alauber,

 

Based to the Python DAQmx documentation (https://media.readthedocs.org/pdf/nidaqmx-python/latest/nidaqmx-python.pdf) 

you should be able to set channels scaling when creating and defining the channel - by providing the custom scale name as one of the parameters.

 

Below you can find the function prototype for creating the AI channel (page 186 of the documentation):

 

add_ai_voltage_chan(physical_channel, name_to_assign_to_channel=u’‘, terminal_config=, min_val=- 5.0, max_val=5.0, units=, custom_scale_name=u’‘


where custom_scale_name (Optional[str]) – Specifies the name of a custom scale for the channel. If you want the channel to use a custom scale, specify the name of the custom scale to this input and set units to FROM_CUSTOM_SCALE.

 

Let me know if this was helpful.

 

 

 

 

---
CLA,CTD,CLED
0 Kudos
Message 2 of 3
(2,651 Views)

Thank you for your reply. I try to write it more clear:

I would like to get the name of the user defined scaling for every channel in a task which I load with:

task = nidaqmx.system.storage.presisted_task.PresistedTask('task_name').load()

 

 

0 Kudos
Message 3 of 3
(2,639 Views)