# d_in()

Reads a digital input port.

Note that for some port types, such as 8255 ports, if the port is configured for DIGITALOUT, this function will provide readback of the last output value.

## Prototype

d_in(board_num, port_type)

## Parameters

board_num (int)

The number associated with the board when it was installed with InstaCal or created with create_daq_device().

port_type (DigitalPortType)

The digital port to read. Some hardware allows readback of the state of the output using this function; refer to board-specific information for support information.

## Returns

- The digital input value (int)

## Notes

- Port size can vary. The return value is 0 to 65,535 for a 16-bit port, 0 to 255 for an 8-bit port, and 0 to 15 for a 4-bit port. To read ports larger than 16-bit, use d_in_32().
- Refer to board-specific information for valid PortType values.