ReferenceDriverNIDigital Write Task

NI Digital Write Task

Learn how to send digital 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 digital outputs (1 = high, 0 = low)
  • 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 digital output channel configurations

Channel Configuration

DO Channel NI-DAQmx C API Reference

ParameterTypeRequiredDefaultDescription
devicestringYes-Device identifier
portnumberYes-Physical port
linenumberYes-Line number on the port

Important Rules

  • Command/State pairs: Each digital 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