Solution
The 9401, 9402, and 9403 modules are designed to be bidirectional without requiring any hardware or software configuration. This is done by taking advantage of the similarities between a sourcing output and an inverted sinking output.
The figures below include a simplified circuit to demonstrate the functionality of the 940x devices as bidirectional sinking/sourcing outputs:
Figure 1: 940x Module Wired as a Sourcing Digital Output
When the load is wired up in a sourcing configuration, as shown in Figure 1, the 9401, 9402, and 9403 will push current through the load when the digital output is set to high. When the output is low, the digital line is grounded.
Figure 2: 940x Module Wired as a Sinking Digital Output
When the load is wired up in a sinking configuration, as shown in Figure 2, the 9401, 9402, and 9403 will pull current through the load when the digital output is set to low.
Notice that when the digital output is set to high, the digital output is 5V rather than an open circuit, which prohibits current flow so long as the external power supply matches the internal supply.