09-26-2018 06:50 AM
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.
10-01-2018 06:19 AM - edited 10-01-2018 06:20 AM
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.
10-05-2018 06:14 AM
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()