PLC programming
Earlier articles
Selection guide
Migrating a MicroLogix 1500 machine to a current PLC
Quote CompactLogix as the baseline for the rebuild: Rockwell's migration reference gives the MicroLogix 1500 two documented destinations, MicroLogix 1400 or CompactLogix 5370 (L1/L2), and a low-volume machine rebuild does not justify the Micro850 route. Take the Micro850 only for high build volume, after the 11 uncovered inputs, serial Modbus, the drive interface and a trial CCW import are verified.
How-to
How to verify AI-generated PLC code before you trust it
A clean compile proves your AI-generated rung is syntactically valid for the project, not that it behaves correctly. Write a behavior specification first — states, startup, fault response, reset — then run normal, abnormal and restart tests in an isolated environment before any download to operating equipment. Generated logic earns trust the same way hand-written logic does: by passing a test written before the code was accepted.
How-to
How to run two TwinCAT PLC programs on one laptop
Merge both PLC projects into one TwinCAT XAE system configuration and activate it once. The XAE assigns each PLC project its own ADS port (851 to the first, 852 to the next by default numbering), and both programs reach RUN on the local runtime. Changing the port in one of two separate XAE projects does not work, because one activation replaces the other.
Explainer
How Q series PLC addressing works for I/O and analog modules
A Q series point's address comes from the I/O assignment: 16-point hex blocks numbered in mounting order through one sequence shared by X and Y, so two 32-point input cards then two output cards land at X0000, X0020, Y0040 and Y0060. Analog values never appear in X/Y space; they sit in the module's buffer memory, read with FROM or TO through a head number equal to the Start XY with its last hex digit dropped.
Explainer
Editing a CODESYS Raspberry Pi PROFINET controller project
A Raspberry Pi running CODESYS Control executes the compiled application you download to it; it cannot import GSDML, rebuild the project, or safely change I/O or OPC UA mappings on its own. Keep the CODESYS Development System on Windows as the editing tool, deploy builds to the Pi, and reserve the runtime on the controller for execution.
How-to
Build a siren pulse count sequence in S7-1200 ladder logic
Use a positive-edge request to load a target of 3, 2, or 1 pulses, then run a four-state ladder sequence — idle, start, stop, count — that drives Q6.2 (START) and Q6.1 (STOP) from separate states so the two SIMOCODE Pro V commands never overlap. With a 2.0 s on-time and a 1.0 s gap, the three patterns finish in 11.0 s, 7.0 s, and 3.0 s.
Troubleshooting
Why Modbus cannot transfer a PLC ladder program over TCP
No Modbus address reaches ladder memory: the application protocol defines four data tables — coils, discrete inputs, input registers, holding registers — and program storage is not in any of them. Swapping RTU for TCP changes transport, not protocol. On DirectLogic PLCs the program moves only over K-Sequence or DirectNET through the vendor's programming tools; Modbus stays for mapped user data.
Troubleshooting
Why HMI values show question marks: PLC comms timeouts
Yes — a running PLC program can cause intermittent HMI timeouts by consuming nearly all controller execution time, and clean Ethernet counters do not clear it: utilization measures bytes, not the cost of servicing requests. Work controller load first: Task Monitor above 90% on the dropping units against 7–15% on healthy ones, then message pacing, packet-rebuild address forms, read grouping, and power last.
Explainer
What STEP 7 is in a PLC project, and which one you need
STEP 7 is the engineering software you use to program, configure, diagnose and download to SIMATIC PLCs — a workstation tool, not a part of the PLC itself. SIMATIC Manager, also called STEP 7 Classic, configures S7-300 and S7-400 CPUs; STEP 7 inside TIA Portal configures S7-1200 and S7-1500. Read the CPU family from the module label or the existing project, open the matching environment, and confirm the project's hardware configuration matches the installed CPU before you edit or download.
Troubleshooting
Recovering alarm data from an undocumented SLC 5/04
An upload from an SLC 5/04 returns the running logic and data files but no symbols or descriptions, because the processor never stores them. Recover alarm meaning from the operator interface tag database, any older backup and the electrical drawings, trace each alarm backward through the logic, then map only explained addresses into the gateway.
Troubleshooting
PLC-5 not visible in RSLinx after processor replacement
A replacement PLC-5 stays invisible in RSLinx because the 1785-ENET sidecar answers the network on its own while the processor waits for an application that configures the Ethernet channel 3A. Leave the non-isolated serial port disconnected until the cable is checked, bring the processor up over serial DF1 or DH+, download the saved program, and the Ethernet path returns.
How-to
PLC-5 heartbeat without the PLC-5 sending messages
Let the ControlLogix do all the sending: it either writes an incrementing heartbeat word to the PLC-5 over Ethernet MSG or pulses a spare output into a spare PLC-5 input, and the PLC-5 resets a watchdog timer only on a genuinely new value or pulse edge — never on message-complete status. Set the preset above two update periods plus measured transfer delay; in the worked example, 1500 ms detects a dead link within 1.5 s.