ni / nidaqmx-python

A Python API for interacting with NI-DAQmx
Other
440 stars 154 forks source link

Allocate Buffer Size for Read/Write String Status Properties #537

Closed charitylxy closed 7 months ago

charitylxy commented 7 months ago

What does this Pull Request accomplish?

This PR aims to address issue mentioned in https://github.com/ni/nidaqmx-python/issues/189:

Why should this Pull Request be merged?

In this PR to address https://github.com/ni/nidaqmx-python/issues/189, following changes have been made:

What testing has been done?

Manually tested overtemperature_chans with overtemp real device TS-15200.

import pprint
import nidaqmx

with nidaqmx.Task() as task:
    # Channel Settings
    voltage_setpoint = 0
    current_setpoint = 0.03
    output_enable = True

    task.ai_channels.add_ai_power_chan(
        "TS1Mod1/power", voltage_setpoint, current_setpoint, output_enable
    )
    task.start()

    if task.in_stream.overtemperature_chans_exist:
        print(f"overtemperature chans: {task.in_stream.overtemperature_chans}")

    task.stop()

Results: overtemperature chans: ['TS1Mod1/power']