ReferenceDriverNIAnalog Write Task

NI Analog Write Task

Learn how to send analog commands to NI devices with Synnax.

For task lifecycle management, see the Task Basics page.

How Commands Work

Write tasks use command and state channels:

  • Command channels (_cmd): Write values here to set analog outputs
  • State channels (_state): Reflect the current output state
  • Command time channels (_cmd_time): Index channels storing command timestamps

When you write to a command channel, the task processes it and updates the state channel, providing acknowledgment that the command was executed.

Task Configuration Reference

ParameterTypeRequiredDefaultDescription
namestringYes-Human-readable task name
state_ratenumberNo20Rate (Hz) at which state channels are updated
data_savingbooleanNofalseEnable permanent storage in Synnax
auto_startbooleanNofalseAutomatically start task after configuration
channelsarrayYes-List of analog output channel configurations

Channel Types Reference

Voltage (ao_voltage)

ParameterTypeRequiredDefaultDescription
cmd_channelnumberYes-Synnax command channel key
state_channelnumberYes-Synnax state channel key
devicestringYes-Device identifier
portnumberYes-Physical port
min_valnumberNo-10.0Minimum voltage (Volts)
max_valnumberNo10.0Maximum voltage (Volts)
custom_scaleobjectNo-Custom scaling

Current (ao_current)

ParameterTypeRequiredDefaultDescription
cmd_channelnumberYes-Synnax command channel key
state_channelnumberYes-Synnax state channel key
devicestringYes-Device identifier
portnumberYes-Physical port
min_valnumberNo0.004Minimum current (Amps)
max_valnumberNo0.02Maximum current (Amps)
custom_scaleobjectNo-Custom scaling

Important Rules

  • Command/State pairs: Each analog output requires both a command and state channel.
  • One task per module: Only one running task can claim a module at a time.
  • State rate: Higher state rates provide faster feedback but consume more resources.

How-To

Console

Python

TypeScript