0.60

ReferenceHardwareNational InstrumentsDigital read task

NI digital read task

Read the digital input lines of an NI device into channels.

An NI digital read task reads the digital input lines of one NI device into channels. Each line gives 0 or 1. For example, it can record limit switches on port0/line0 and port0/line1 of a USB-6343.

Before you start, you need a configured device.

Ports and lines

NI devices group digital lines into ports. Each channel reads one line, set by its port and line numbers. The device manual lists the ports and lines.

The Driver reads the lines on the computer clock, at the Sample rate. See timing.

Create an NI digital read task

Enterprise
  1. In the devices toolbar, right-click the device and select Create digital read task.
  2. Set Sample rate and Stream rate.
  3. Click Add channel, then enter the port and the line in Port/Line.
  4. Click (Start).

The Console creates the channels. For a device with the identifier dev1, port 0, line 1 gives dev1_di_0_1, with the index channel dev1_di_time.

Task options

Console label Python field Default Notes
Device device The key of the device.
Sample rate sample_rate 10 Hz Up to 1,000,000 Hz in the Console.
Stream rate stream_rate 5 Hz Up to 20,000 Hz. See read tasks.
Data saving data_saving_disabled On See data saving.
Auto start auto_start Off Starts the task each time the Driver starts.

Channel reference

Each channel has a channel, the Synnax channel that records the value as uint8. The table shows the Console label of each setting, with its Python field under it.

Setting Default Notes
Port/Line port, line 0/0 The port, and the line in it.

Troubleshooting

For other problems, see Configure an NI device and Troubleshoot hardware.