Data Acquisition Toolbox    

Digital Input/Output


Digital I/O (DIO) subsystems are designed to transfer digital values to and from hardware. These values are handled either as single bits or lines, or as a port, which typically consists of eight lines. While most popular data acquisition boards include some DIO capability, it is usually limited to simple operations and special dedicated hardware is required for performing advanced DIO operations. The Data Acquisition Toolbox provides access to digital I/O subsystems through a digital I/O object. The DIO object can be associated with a parallel port or with a DIO subsystem on a data acquisition board.
The purpose of this chapter is to show you how to perform data acquisition tasks using your digital I/O hardware. The sections are as follows.
Creating a Digital I/O Object
Create a MATLAB object that represents the digital I/O subsystem
Adding Lines to a Digital I/O Object
Associate hardware lines with the digital I/O object
Writing and Reading Digital I/O Line Values
Write values to digital lines, and read values from digital lines
Generating Timer Events
Execute the digital I/O object and configure properties to generate timer events
Evaluating the Digital I/O Object Status
Return the values of certain properties in a convenient display format

Note that the Data Acquisition Toolbox does not directly support buffered DIO or handshaking (latching). However, you can write your own M-code to support this functionality. Buffered DIO means that the data is stored in the engine. Handshaking allows the DIO subsystem to input or output values after receiving a digital pulse.

  Starting Multiple Device Objects Creating a Digital I/O Object