I've found an PLC circuit example with this schematics as output:

In this case there's OUT3 as microcontroller output and an optoisolator that drive a mosfet. Out VCC is 24v that is voltage to drive I/O of loads or other device I/O. OUT3S is output of module.
I can't correctly understand if it's working and if it's correct. Any opinions on this circuit?