# d_out()

Writes a byte to a digital output port.

Most configurable ports require configuration before writing. Check the board-specific information in the Universal Library User’s Guide to determine if the port should be configured for your hardware. When configurable, use d_config_port() to configure a port for output.

## Prototype

d_out(board_num, port_type, data_value)

## 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)

There are three general types of digital ports – ports that are programmable as input or output, ports that are fixed input or output, and ports for which each bit may be programmed as input or output. For the first of these types, set PortType to DigitalPortType.FIRSTPORTA. For the latter two types, set PortType to DigitalPortType.AUXPORT. For devices with both types of digital ports, set PortType to either DigitalPortType.FIRSTPORTA or DigitalPortType.AUXPORT, depending on which digital inputs you wish to read.

data_value (int)

Digital value to write.

## Notes

- Port size can vary. Port size can vary. The output 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 write to ports larger than 16-bit, use d_out_32().
- Refer to the example programs and the board-specific information for valid port_type values.