Specify port ID
Note: You cannot use the legacy interface on 64-bit MATLAB®. See Working with the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
Hardware lines are often grouped together as a port. Digital I/O subsystems can consist of multiple ports and typically have eight lines per port. When adding hardware lines to a digital I/O object with addline, you can specify the port ID. The port ID is stored in the Port property. If the port ID is not specified, then the smallest port ID value is automatically used.
Create the digital I/O object dio and add two hardware channels to it.
dio = digitalio('nidaq','Dev1'); addline(dio,0:1,'In');
You can use Port property to return the port IDs associated with the lines contained by dio.
ans =