Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Digital Input and Output

Acquire and generate digital data with National Instruments® devices

To learn how to create a session and acquire or generate digital data, see Digital Input and Output Workflow.

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

Functions

addDigitalChannelAdd digital channel
inputSingleScanAcquire single scan from all input channels
outputSingleScanGenerate single scan on all output channels
startForegroundStart foreground operations
startBackgroundStart background operations
addClockConnectionAdd clock connection
stopStop background operation
waitBlock MATLAB until background operation completes
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

Properties

DeviceChannel device information
DirectionSpecify digital channel direction
IDID of channel in session
NameSpecify descriptive name for the channel

Topics

Basic Workflow

Digital Subsystem Channels

Transfer digital or logical values in bits via digital lines.

Acquire Non-Clocked Digital Data

Acquire a single scan of digital data from two channels of an NI device.

Generate Non-Clocked Digital Data

This example shows how to write data to two lines on an NI 625

Acquire Digital Data Using an External Clock

Acquire digital data in the foreground using an external scan clock.

More

Acquire Digital Data in Hexadecimal Values

This example shows how to write data using two channels on an NI 6255.

Acquire Digital Data Using a Shared Clock

Share the clock with the analog input subsystem on your device with the digital subsystem.

Acquire Digital Data Using a Counter Output Channel as External Clock

Acquire digital data using a counter output channel to generate clock pulses.

Generate Signals Using Decimal Data Across Multiple Lines

This example shows how to convert decimal data and output to two lines on an NI 6255.

Control Stepper Motor using Digital Outputs

This example shows how to control a stepper motor using digital output ports.

Generate and Acquire Data on Bidirectional Channels

This example shows how to use a bidirectional channel and read and write data using the same two lines on an NI 6255.

Generate Signals on Both Analog and Digital Channels

This example shows how to generate signals when the session contains both analog and digital channels.

Was this topic helpful?