Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

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

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 Kudos
Message 1 of 4
(905 Views)

You know it by referring to the instrument datasheet

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(879 Views)

Thanks for your answer!

So there is no way to code a plug&play system where the code would discover what's plugged in?

0 Kudos
Message 3 of 4
(834 Views)

Possible, this is where smart sensors with TEDS interface come into play.

 

For example, you have got a DAQ with Analog Input - Voltage channel, to this channel you can connect any voltage signal but what this voltage means is completely dependent on where it comes from. Like, a voltage signal from a microphone is a sound, voltage across a current sense resistor is a current, and voltage from a load cell has to be translated to weight.

 

Try to think from the DAQ's shoes and see if you can figure out what kind of signal it is getting just with a single numeric measurement.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 4
(828 Views)