How to know which is the type of a physical channel

Viewed 19

How do I know which kind of data is currently emitted by a physical channel?

physical_chan.ai_meas_types gives me the possible type of data (ex: CURRENT, TEMPERATURE_THERMOCOUPLE, VOLTAGE). I would like to know which one are currently emitting.

Do I try/except add_ai_current_chan to check if a current is emitted? It seems like an ugly hack. Any suggestions?

import nidaqmx.system
system = nidaqmx.system.System.local()

device = system.devices["PXI1Slot2"]

with nidaqmx.Task() as task:
    for physical_chan in device.ai_physical_chans:
        # physical_chan.ai_meas_types gives me the possible options.
        # task.ai_channels.add_ai_current_chan(physical_chan.name)
        task.ai_channels.add_ai_voltage_chan(physical_chan.name)

    print(task.read())
0 Answers
Related