PLC selection, IEC 61131-3 languages and I/O wiring
The right PLC is chosen from the I/O count, the axis count, the cycle time and the communication it must carry. Most problems in the field, though, come from basics: PNP/NPN mismatches, retained data and scan-time overruns.
5 questions answered
Basics
Commissioning
Troubleshooting
Basics
01
Which PLC should I choose for my machine?
Choose a PLC with four questions: how many digital and analog I/O are needed, how many servo axes and which kind of motion (independent, synchronised, interpolated, CNC), what cycle time is targeted, and which networks it must carry (EtherCAT, CANopen, Modbus, Ethernet). Leave headroom for axes and I/O added later.
From single-axis motion to robotics and CNC: the MAT-LC CPU family
Which IEC 61131-3 language should I use: LD, ST, FBD or SFC?
They can all live in the same project, and each suits a different job. Ladder (LD) for discrete interlock logic that maintenance staff can read, Structured Text (ST) for calculation, data handling and motion code, FBD for signal flow and control loops, and SFC for machine sequences that advance step by step. Instruction List (IL) was deprecated in the third edition of the standard.
What is the difference between PNP and NPN sensors, and how do I wire them to a PLC input?
A PNP (sourcing) sensor puts +24 V on its output when active, so it goes to a sinking PLC input whose common is 0 V. An NPN (sinking) sensor pulls its output to 0 V when active and goes to a sourcing input whose common is +24 V. With a mismatch, the input never switches on, or never switches off.
Our inductive, photoelectric and cylinder sensors come in PNP and NPN versions
Standardising on one type per machine avoids spare-part mix-ups
Is a normal PLC input enough for an encoder or fast counting?
Usually not. Standard digital inputs are read and filtered in the PLC scan cycle, so pulses shorter than the scan are missed. To read an encoder, count fast or generate pulses, use a high-speed counter (HSC) or pulse module; these count in hardware, independently of the scan.
The PLC stops with a watchdog error. What causes it?
A watchdog says a task did not finish within the time it was given. Typical causes: a loop over many elements, an endless WHILE loop, file or network work done inside the task, or newly added code pushing the task past its budget. Look at the maximum cycle time in the task monitor and move heavy work to a lower-priority task.