optocoupler H22A2 driving a plc input
Your question is quite unclear but I suspect that you think that the PLC requires a pull-up or pull-down resistor as shown in the Example 2 of your link. This is not the case.







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1.

The PLC input can be connected directly to ground in the case of a current-sourcing type or directly to positive supply in the case of a current-sinking type. Typically about 10 mA will flow and ensure adequate illumination of the internal opto-coupler which isolates the inputs from the internal logic.

For your circuit you wire the opto-isolator's transistor as shown depending on input type.

The current-sinking type of input is often called a PNP input as it would work with PNP-type three-wire industrial sensors. Since you are using a "two-wire" opto-transistor the NPN transistor works in both configurations.



Update after links posted.



Figure 2. The PLC accepts sinking, sourcing or AC configuration.

That means that there are back-to-back diodes or a rectifier on the inputs.







simulate this circuit

Figure 3. Options for interfacing your opto-switch.

Choose (a) or (b) to suit other switches in the system.



Update 2:







simulate this circuit

Figure 4. Redrawn OP's schematic.

Corrected version of your schematic is above. Note that this is the same as I drew in Figure 3b.



Figure 5. Correct schematic with current path highlighted.