the LJ12A3-4-Z/BX is a N/O switch that functions like a machanical N/O that can l be connected between the common ground and either a PC's parallel printer port input or TTL input of a BOB like CNC4PC's C10
0.8V is a valid TTL logic 0 and over +4V a logic 1
what BOB are you using ?
to get +24V you could either have the PNP version that connects the positive supply to the output
or made an error wiring the NPN switch
John