Definition
PLC (Programmable Logic Controller) is a core device in industrial automation, implementing sequential control, interlock logic, timing, counting, and more. It supports protocols such as Modbus, EtherNet/IP, Profibus, OPC UA, etc. Industrial gateways and DTU can aggregate PLC data and report it to SCADA, MES, and cloud platforms.
System Composition
A PLC consists of a CPU, I/O modules, power supply, programming interface, and other components. The CPU executes programs in ladder diagram, instruction list, structured text, etc.; digital I/O connects to switches, relays, and sensors; analog I/O connects to 4–20mA, 0–10V, and similar signals; communication modules support Modbus, EtherNet/IP, Profibus, OPC UA. PLCs connect to inverters, servos, robots, instruments, and other devices via fieldbus or Ethernet.
Data Acquisition
Industrial gateways and edge gateways collect data such as operational status, output, faults, and process parameters from PLCs through protocols like Modbus TCP/RTU, OPC UA, EtherNet/IP, etc., and report them to SCADA, MES, and cloud platforms via MQTT and HTTP. They support applications such as OEE calculation, predictive maintenance, and digital twins. When selecting, it is necessary to confirm the protocols supported by the PLC and the data address mapping.
Scan Cycle and the Process Image
The program reads the image, then writes the image, once per cycle
Each cycle a programmable controller does three things: it copies the state of the input terminals into the input image, it executes the program from top to bottom, and it writes the output image to the terminals. An input the program reads is the snapshot from the start of this cycle, not the level on the terminal at this microsecond. Even if a terminal changes in the second half of the same cycle, the logic still uses the value from the start until the next pass. That delay is part of interlock design. If collection software infers "the field just acted" from the arrival time of a communication frame, it will be off by one to several scans.
Timers and counters hang on the same cycle table. Timer accuracy is usually a multiple of the scan. When the scan lengthens because of a communication task, the timers slow down with it. Treat an internal controller timer as a millisecond measurement reference, and line takt drifts with the load. An interrupt routine can catch a few inputs faster, but what an interrupt is allowed to do is limited. Do not assume every point has interrupt-level response.
Separate the logic task from the communication task
It fits sequence, interlock, counting, and analog regulation that is not very fast, with the program and the I/O modules managed in one project. External communication is an added task. It uses whatever scan time is left. If the collector sets a very high refresh and reads a large block of registers at once, the controller may extend the scan and, in a severe case, trip the watchdog. The conditions for use are a point list with stable addresses, a collection period clearly slower than the scan, writes limited to setpoints that are explicitly allowed, and safety interlocks kept inside the controller, not dependent on a network round trip.
Compared with a DCS, what is more common here is one controller looking after one machine or one section of machinery, with the program maintained by the machine builder. Remote data should be read from an image area that has already been mapped. Do not let a gateway drive a safety output directly. An analog module also has its own conversion time. An updated image does not mean the sensor has completed a new conversion.
Scan timeout and overlapping addresses
Overlapping addresses are a typical error in a retrofit. After an expansion-module slot changes, the old input word moves to a new address. The old program and the new collector each use their own table, and the same signal appears as two values. Before downloading a program, export the variable table and diff it against the collection point list. Second, a scan timeout is dragged out by communication. Online monitoring, forced coils, and large-packet reads at the same time reset the watchdog, the machine stops, and the log records it as "a brief network drop."
If a force is left behind on site, the real state of a terminal no longer equals the image. A multimeter and the display never agree during troubleshooting. For analog values, also check the scale from raw code to engineering units. One scale in the controller and another in the host puts a gap in the curve. Finally, do not set an RS485 slave timeout shorter than the controller scan. The master will declare a communication failure before the controller has refreshed the image, and the more points there are, the more false alarms there are.
Program version and collection point list have to change together. Upgrade only the controller program, and do not tell the collector, and a new interlock bit is read as unrelated data at the old address. A command point may even be written to a coil that has been reused for something else. The change note should keep the variable-table diff. Remove write protection only after the collector has been updated, so the two projects are not edited apart from each other.