I do know how to use this sensor as input to PLC.
The answer depends on the PLC you will connect the sensor to.
What type of input does your PLC have?
There are two types, these are called:
- PNP. Also called "sinking input", since the PLC "sinks" the current from the sensor.
- NPN. Also called "sourcing input", since the PLC "sources" current to the sensor.
In fact there are other types (for example "AC"), but these are very rare.
How are they different?
Assuming the PLC is powered up, then:
PNP: With nothing connected there will be 0V at the PLC input. The PLC registers this as "OFF". If you connect this input to +24V (say) through a resistor, say, a 1k-ohm, then the voltage at the input will change (go closer to +24V) and the PLC will register this as "ON".
NPN: With nothing connected there will be about +24V at the PLC input (it may be different to +24V, it will be whatever the PLC's internal power supply voltage is). The PLC registers this as "OFF". If you connect this input to 0V through a resistor (1k-ohm), then the voltage at the input will change (go closer to 0V) and the PLC will register this as "ON".
The image below explains this, it shows how each type of sensor is connected to the correct type of PLC input, this was sourced from:
How do I tell what type of input the PLC has?
I would use a DC volt meter to measure the voltage at the PLC input with nothing connected. The voltage you see there will tell you which type of input it is. I would then test it by connecting a resistor from the input to the opposite voltage.
Why use a 1k resistor, why not just use a wire?
I recommend using a resistor as a precaution just in case something is not as you expect. The idea is that the resistor will limit the current that will flow, so hopefully nothing gets damaged. For example, we have assumed that the PLC inputs are wired for 24V, but perhaps that is not correct - it could be expecting 5V, for example. Connecting 24V directly to a 5V DI is very likely to damage it. This can be a problem with PNP inputs because the default voltage with nothing connected is 0V, which does not tell you what voltage it is expecting. With NPN inputs, the voltage is already high, and you just connect it to 0V to register "ON".
If I had no datasheet about the PLC, then in fact I would probably start with a 10K resistor first, if that does not cause the PLC to register the input as being ON, I would reduce the resistor to 2k2, then 1k, then 470R, then 220R, and lastly 100ohm. If the PLC does not register ON with 100r then something is very likely wrong.
What happens if I connect the wrong type of sensor to the PLC input?
Usually nothing. The PLC will see the input as OFF regardless of whether the sensor output is ON or OFF.
If I have the wrong sensor type, what can be done?
You will need to change the output of the sensor to the correct type. You can use a relay for this, or transistors. Using a relay is OK for slow inputs; but if input is faster than, say, 5 pulses per second, then I would recommend transistors.
The product below can convert any type to the opposite type just by how you wire to it, it is a DIN-rail mounted device just 6.2mm wide, here is the link: