# DIn()

Reads a digital input port.

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

Refer to the "Digital Input/Output Hardware" topic for additional details on using the UL digital I/O methods.

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function DIn(ByVal portType As MccDaq.DigitalPortType, ByRef dataValue As Short) As MccDaq.ErrorInfo

Public Function DIn(ByVal portType As MccDaq.DigitalPortType, ByRef dataValue As System.UInt16) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo DIn(MccDaq.DigitalPortType portType, out ushort dataValue)

public MccDaq.ErrorInfo DIn(MccDaq.DigitalPortType portType, out short dataValue)

## Parameters

portType

Specifies which digital I/O port to read. Some hardware does allow readback of the state of the output using this method; refer to board-specific information in the Universal Library User's Guide.

dataValue

The digital input value.

## Returns

- An ErrorInfo object that indicates the status of the operation.
- dataValue – the digital input value.

## Notes

- Port size can vary. The return value is 0 to 232 –1 for a 32-bit port, 0 to 224 –1 for a 24-bit port, 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 a 32-bit port, use DIn32().
- Refer to the board-specific information in the Universal Library User's Guide for clarification of valid portType values.