Controls Library
Earlier articles
Troubleshooting
Why a CJ2M Modbus RTU master gets no answer from an S7-1200
Yes, a CJ2M can poll an S7-1200 over Modbus RTU. The simulators proved each PLC's serial settings, not the cable or the port mode between them: set the Omron port to the mode the MRTU_CPU_Master package requires, bring the send pair onto RDA and RDB for 2-wire operation, load the S7-1200 port at even parity, and confirm the frame on the wire with a known value.
Troubleshooting
Fix ABB IRC5 PROFINET word values with a byte swap
A word of 100 written from an S7-300 arrives at an ABB IRC5 Group Input as 25600: the PLC stores words big-endian, the Group Input reads the first byte as the low byte. Swap the two bytes in exactly one place, preferably an SCL block in the PLC, and the robot reads 100.
How-to
How to add a 4-20 mA sensor to a PLC without analog inputs
Connect the transmitter through a CP1W analog input expansion unit on the CP1E's expansion connector and scale it with Pressure_bar = (I_mA - 4) × (10 bar / 16 mA). If no expansion unit fits, convert the 4-20 mA loop to a 0-1 kHz pulse train with a 24 VDC signal conditioner and count it on a high-speed counter input over a fixed gate.
Explainer
What you must configure on the PLC side for Modbus TCP
On the PLC side you always provide the IP address, port 502 and the register map — but the serving mechanism is what differs: the S7-1200, the Omron CP2E and the Speed7 family need the manufacturer's server function blocks called cyclically, while a ControlLogix needs a socket-based add-on instruction.
Comparison
How HART, Fieldbus, Profibus and Modbus compare
Match the protocol to the application, not the name. HART rides an existing 4–20 mA loop with digital configuration and diagnostics; Foundation Fieldbus builds an engineered digital segment for distributed process devices; Profibus serves configured cyclic automation networks; Modbus gives simple register exchange with the widest interoperability. Choose by what carries the process value, how often it updates, which diagnostics you need, and what cable is already installed.
How-to
Amplifying a 0-20 mA PLC output to drive a 165 mA solenoid
No PLC analog output supplies 165 mA directly: the SM 1232 tops out at 20 mA, so you add a closed-loop current amplifier that draws solenoid power from the 24 V rail. The gain is 8.25, set by an 82.5 Ω input resistor over a 10 Ω sense resistor; a 102 Ω coil drops 16.83 V at full scale, leaving 5.52 V and 0.91 W in the pass transistor.
Troubleshooting
Fix small nonzero counts at zero flow on a DVP04AD-E2 input
Counts of 20-30 at 4 mA on a 0-32000 span are 0.06-0.09% of span, about 10-15 µA of loop error: that is normal converter offset and jitter. Verify the loop with a calibrator, calibrate measured endpoints per channel, then filter. A reading of 100 counts on another channel is a wiring or channel-offset clue, not a scaling error.
Explainer
What counts as a fieldbus instance in CODESYS licensing
A master or controller in the CODESYS device tree is one fieldbus instance, no matter how many slaves it polls; a slave device the runtime serves counts one instance each. Modbus TCP demo operation stops after two hours with no reported connection or request caps. Control Standard S provides 4 instances, 1 of them complex; Standard L provides 2 complex instances.
Selection guide
Selecting multi-channel Modbus analog input remote I/O
Sixteen 4-20 mA loops become Modbus data through remote I/O with current-rated analog inputs, never through a serial converter. Match input type and loop power first, then channel count — one 16-channel single-ended module or two 8-channel differential modules — and buy only against the manufacturer's register map.
Selection guide
Selecting a PROFINET controller gateway for a Modicon M580
The M580 cannot reach the 74 SIMOCODE devices through a switch or a bridge whose PROFINET side is an IO device. Select a gateway whose PROFINET side is an IO Controller rated for at least 74 devices and whose PLC side is a Modbus TCP server or EtherNet/IP adapter, then size it from 74 times each device's configured I/O bytes plus gateway overhead.
Troubleshooting
Troubleshoot CC-Link inputs working but no digital outputs
Working inputs with dead outputs on a Version 1 remote device station are an RY mapping fault, not a broken link. Three occupied stations give RY offsets 00–5F — 96 bits at Y1000–Y105F — and the digital-output channels sit where the head station's output process image puts them, not where the inputs suggest. Set the master's rack entry to 32 points, confirm RY refreshes to Y1000, read the output image table, then trace one bit.
How-to
Set up a CLICK Plus as Modbus TCP client to an S7-1200
Yes: make the S7-1200 the Modbus TCP server with MB_SERVER mapped to a data block of INTs, and make the CLICK Plus the client with Send and Receive instructions aimed at the CPU's IP address and port 502. Write the shared register map first; the S7 logic copies physical inputs into it and applies its output words to the real outputs.