0.60

ReferenceHardwareLabJackWrite task

LabJack write task

Write command channel values to the analog and digital outputs of a LabJack.

A LabJack write task writes the values of command channels to the outputs of one LabJack device. For example, a valve on a schematic can switch DIO4, and a setpoint can drive DAC0.

Each output has a command channel and a state channel. When you deploy the task, every output starts at 0. When you stop and start the task from the tasks toolbar or from code, the outputs go back to the last commanded values.

Before you start, you need a configured device.

Create a LabJack write task

When you create command channels with a client library, give each one its own index channel. A writer that holds several commands on one index must write all of them in every frame.

Enterprise
  1. In the devices toolbar, right-click the device and select Create write task.
  2. Set State update rate.
  3. Click Add channel. In the port list of the channel, select Analog or Digital, then select the port.
  4. Click (Start).

The Console creates the channels. For a device with the identifier lj1, the output DIO4 gives the command channel lj1_DIO4_cmd with the index lj1_DIO4_cmd_time, and the state channel lj1_DIO4_state with the index lj1_write_state_time.

Task options

Console label Python field Default Notes
Device device The serial number of the device.
State update rate state_rate 10 Hz How often the task writes the state channels.
Data saving data_saving_disabled On See data saving.
auto_start Off Starts the task each time the Driver starts. Code only.

Channel reference

Each channel has a cmd_channel and a state_channel. Both are required.

Analog

Python AnalogWriteChannelTypeScript analog

Outputs a voltage. The command is in volts, as float32.

Setting Default Notes
port DAC0 A DAC port.

Troubleshooting

For other problems, see Configure a LabJack device and Troubleshoot hardware.