| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Data Acquisition Toolbox |
| Contents | Index |
| Learn more about Data Acquisition Toolbox |
When adding hardware lines to a digital I/O object with addline, you must configure the line direction. The line direction can be In or Out, and is automatically stored in Direction. If a line direction is In, you can only read a value from that line. If a line direction is Out, you can write or read a line value.
For line-configurable devices, you can change individual line directions using Direction. For port-configurable devices, you cannot change individual line directions.
Usage | DIO, per line |
Access | Read/write |
Data type | String |
Read-only when running | Yes |
{In} | The line can be read from. |
Out | The line can be read from or written to. |
Create the digital I/O object dio and add two input lines and two output lines to it.
dio = digitalio('nidaq','Dev1');
addline(dio,0:3,{'In','In','Out','Out'});To configure all lines for output:
dio.Line(1:2).Direction = 'Out';
![]() | DefaultChannelValue | EventLog | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |