Fixittt,
What voltage are you running G540 on?
The part should work with a G540 except for the issue of voltage issolation.
I have just had a quick look at the full datasheet:
http://web2.automationdirect.com/sta...oxrectaps4.pdf
The wiring should be:
Brown => +ve supply
Black => Input terminal of G540 (wired directly)
Blue => -ve supply
The gotcha is the -ve supply feeding the proximity sensor must also be connected to the -ve supply of the G540. The APS4-12S-E-D has a maximum voltage rating of 30V DC (most simple voltage regulators also have a maximum input voltage of 30V except possibly the 7824 which is typically 40V).
David Campbell