Main Content

Digital Input and Output

Acquire and generate digital data with data acquisition hardware

Digital subsystems perform read and write operations to transfer and receive digital or logical values in bits via digital lines. Data Acquisition Toolbox™ provides a DataAcquisition interface to perform these operations in clocked and non-clocked systems.

Add digital subsystem channels, known as digital lines, to your DataAcquisition interface object using the addinput, addoutput, or addbidirectional functions.

  • Input only channel — Acquire digital data using the read operation.

  • Output only channel — Generate digital data using the write operation.

  • Bidirectional channel — Acquire or generate digital data by modifying the channel direction. You can set the direction to either Input or Output, but not both at the same time. By default, the direction is Input.

Before you use digital channels, see Hardware Discovery and Setup.

Functions

expand all

addinputAdd input channel to device interface (Since R2020a)
addoutputAdd output channel to device interface (Since R2020a)
addbidirectionalAdd digital bidirectional channel to device interface (Since R2020a)
removechannelRemove channel from device interface (Since R2020a)
readRead data acquired by hardware (Since R2020a)
writeWrite output scans to hardware channels (Since R2020a)
readwriteSimultaneously read and write device channel data (Since R2020a)
startStart DataAcquisition background operation (Since R2020a)
stopStop background operation (Since R2020a)
preloadQueue scan data for device output (Since R2020a)
flushFlush DataAcquisition input and output buffers (Since R2020a)
decimalToBinaryVectorConvert decimal value to binary vector
binaryVectorToDecimalConvert binary vector value to decimal value
hexToBinaryVectorConvert hexadecimal value to binary vector
binaryVectorToHexConvert binary vector value to hexadecimal

Topics

Digital Subsystem

Digital Data Acquisition

Digital Data Generation

Bidirectional System

Featured Examples