Normally, a 3-pin rocker switch can be wired as such.
(+) pin to 24 VDC power supply (+); may ne called "in" or "source"
(-) pin to ground
(s) pin to PLC input channel. This pin may be called "signal", "accessory", "out", etc.
When you connect to the (+) side of the power supply, you must use the same circuit that is wired to the PLC card.