The most common type NPN sensor has 3-wire. You connect one to +24V (same as PLC power supply), another one to 0V (again same as PLC power supply) and the 3rd wire is the signal wire, just connect it to the PLC's input.
Now any sensor that detect an object will be a logic '1' (ON) to the PLC. Your program can process the signal, e.g. increment a counter or trigger some output etc. If the PLC is connected to a PC running TLServer then the PLC is accessible from other stations in the corporate Intranet or even the Internet.