I'd first try wiring a led, with a 4.7k series resistor between, 24v and NPN. It is not clear from the document if the led will be on or off during a detection but that would be the first thing you would discover with this experiment.
The optocoupler is a good idea so you don't have to share either of the 24v supply power rails with the Arduino.