The following diagram displays a configuration with GPIO 3 set to Input and GPIO0, GPIO1, and GPIO2 set to Output.
The GPIO Outputs are the Current Source (PNP), and the GPIO Input is the Current Sink (PNP). Input is received from a PNP proximity sensor. The power source is a PLC 24VDC PSU, and the GPIO functions are not opto-isolated.