Troubleshooting
Why a Modbus write loses control of a CLICK PLC Y output
Short answer
A Modbus write to a CLICK PLC Y output fails because any OUT coil in the ladder re-solves its rung every scan and overwrites the written bit within milliseconds. Keep the on/off state in a C bit, let exactly one rung drive the Y output, and point the master at the command bit. A direct write to a Y register survives only where SET and RST are the only instructions touching it, or where no logic touches it.

On this page
Your Modbus write loses the Y output because the ladder program, not the network, owns that register. On a CLICK PLC a Y bit behaves like ordinary bit memory, and an OUT coil anywhere in the program re-solves its rung on every scan and overwrites whatever the master wrote, within milliseconds. Hold the on/off state in a C bit, let exactly one rung drive Y1, and point the Modbus TCP master at the command bit instead. A direct write to a Y register is viable in exactly two cases: the bit is touched only by SET and RST instructions, or no instruction touches it at all. The sections below give the scan behavior behind that rule, the toggle rung that cancels itself, the decision for each case, and the six rungs that make the pushbutton and the master equal partners.
Why the write does not stick #
Two behaviors of the CLICK scan decide the outcome. First, register changes take effect immediately, rung by rung: if rung 1 writes Y1 and rung 2 tests it, rung 2 sees the new value in the same scan. Second, the physical transistor points are driven from their own output-image registers, updated at the end of the scan and readable by no instruction; between those two facts, a Y bit behaves exactly like a C bit that happens to drive hardware.
An OUT coil is the writer that beats you. It stores its rung result into its bit on every scan, while the Modbus write lands once, and the next solution of the coil's rung replaces the master's value in milliseconds. Two writers to one address: the one that runs every scan wins. Whether a Modbus write changes a PLC output at all depends on that instruction, and the can a Modbus write change PLC outputs walkthrough takes the question case by case.
The toggle rung that cancels itself #
The rung pair everyone writes first for a pushbutton that toggles an output cannot work:
- Rung 1: a leading-edge contact on pushbutton X1, in series with a normally closed contact on Y1, drives SET Y1.
- Rung 2: the same edge contact, in series with a normally open contact on Y1, drives RST Y1.
On the press, rung 1 sets Y1 to 1. Rung 2 is solved in the same scan, sees Y1 equal to 1, and resets it to 0. The end-of-scan image latches 0 and the physical output never moves. Swap the rung order and the failure inverts: the output can never turn off. The same cancellation eats the master's writes, because an ON write to Y1 lands between two rungs that rewrite it every scan.
That trap is the immediate-update behavior above, and it is the same snapshot-versus-immediate timing question the PLC input scan timing walkthrough works through for input images; here the Y bits play the role the input images play there.
Decide where the master is allowed to write #
Pick the case by what touches the Y bit:
- An OUT coil drives it. The coil wins every scan and a direct write is dead at any write rate. Do not write Y from the master; write a C command bit and decode it in ladder. With more than one driving condition on the output, this is the only workable choice.
- Only SET and RST drive it. A Modbus write sticks while both rungs' logic is false: the master's ON holds until your SET condition fires, and your RST condition clears it again. Put the RST rung after the SET rung so a stop overrides a start if both ever fire in one scan.
- No instruction touches it. The master owns the register. Direct writes work and hold as long as nothing in the program changes the bit.
For a cabinet that runs no local logic at all, the PLC used purely as remote I/O, the programming software's help topic CL242, Using CLICK as Remote I/O, documents the register handling that use case needs.
One safety line belongs here: an output that a network master and a pushbutton can both flip must never be the only stop path for a motor, so keep the hardwired emergency-stop chain outside the PLC.
The fix: state in a C bit and one rung on Y1 #
Five C bits give both command sources a clean interface. X1 is the field pushbutton; C1 is the master's request, a single address that means "toggle", which is exactly what a screen limited to one writable bit needs; C10 is a one-scan pulse; C20 is the state of record; C21 is the start-of-scan snapshot of C20.
- Snapshot rung: a normally open contact on C20 drives OUT on C21, solved before anything modifies C20 in that scan.
- Pulse rung: a leading-edge contact on X1 in parallel with a leading-edge contact on C1 drives OUT on C10.
- Consume rung: C1 drives RST on C1, so a master that can only write ON still toggles on every press.
- Toggle ON: C10 in series with a normally closed C21 drives SET on C20.
- Toggle OFF: C10 in series with a normally open C21 drives RST on C20.
- Output rung: C20 drives OUT on Y1, the only instruction in the whole program that writes Y1.
Both toggle rungs test C21, the value captured before any modification, so exactly one of them is true per pulse; the snapshot is what breaks the rung-2-sees-rung-1's-write trap. If the difference between an OUT coil and SET/RST is new material, the ladder logic symbols reference shows what each symbol in a rung writes and when.
A master that can write an integer instead of a single coil gets a sturdier mailbox: a command word in a DS register, where 1 means ON, 2 means OFF and 3 means toggle, and the ladder clears the word after acting. Absolute commands survive a dropped or duplicated packet far better than a toggle, because the next command resynchronizes both sides. That route crosses CLICK's Modbus addressing conventions on the way, and why a Modbus write to CLICK PLC DS1 needs address 0 walks the mapping so the word lands where you aimed it.
Worked example: one 1000 ms write against a 5 ms scan and an OUT coil #
Inputs:
- Master write interval: 1000 ms, an example rate for a rule that pulses the coil once per second.
- Program scan time: 5 ms per scan, an illustrative figure in the range a small CLICK program measures; the documented mechanism needs only that the coil re-solves on its next solution, within milliseconds.
- One OUT coil whose rung result for Y1 is 0, so the ladder holds the output OFF.
Rule in words: an OUT coil writes its rung result into the bit on every scan, so the master's write survives at most one scan, and the coil overwrites once per scan until the master writes again.
Arithmetic:
- Overwrites between writes: 1000 ms / 5 ms per scan = 200 scans, each ending with the coil's 0 in the register.
- Lifetime of the written ON: the one scan before the coil's next solution.
- Share of the interval the master's state is live: 5 ms / 1000 ms = 0.5%.
Result: across each second the physical output shows the master's ON for at most 5 ms and the coil's OFF for the remaining 995 ms.
Decision: with an OUT coil on the bit, a direct write fails at any practical rate, because even raising the write rate to every 100 ms leaves the master's state live under 5% of the time (5 ms / 100 ms = 5%); write the command bit C1 instead. A direct Y1 write belongs only to the SET/RST-only and no-logic cases, where the same write holds not for one scan but for as long as the driving logic stays false.
Checks when the output still misbehaves #
- Search the program for every use of the Y address. A second OUT coil on it, left over in an interlock or fault rung, is the override; make the output rung the only writer or convert the stray to SET/RST.
- Confirm the address the master actually writes against the register addressing the programming software shows for each block; an off-by-one between your master's numbering and the PLC's lands the write on a neighbor bit and looks exactly like an override that silently does nothing.
- Watch the state machine live. If C20 toggles and the physical output does not follow, the fault sits downstream of the output rung: field wiring, the output point itself, or another instruction sneaking a write to Y1.
- If the toggle works once and every later press reads dead, the request bit is latched ON; check the consume rung is present and that the master is not rewriting it ON on every poll.
The decision in one line: one address per command, one writer per bit, one rung per output. The master writes the command bit, the ladder decides, and Y1 answers to a single instruction, so the pushbutton and the network cooperate instead of fighting over a register the program rewrites every scan.
Questions asked
Which Modbus function codes reach CLICK PLC C, Y, DS and X registers?
C bits and Y bits map as coils: function code 01 reads them, codes 05 and 15 write them. DS registers map as holding registers: code 03 reads, codes 06 and 16 write. X inputs are read as discrete inputs with code 02 and cannot be written. Confirm the protocol address of each register block in the programming software instead of assuming one numbering convention.
Why does the toggle work exactly once and then the button reads dead?
The master wrote the request bit ON and nothing cleared it, so the leading-edge contact fired during a single scan and never sees a rising edge again. Keep the rung that resets the request bit once the pulse rung has consumed it, or have the master pulse the coil back OFF after each command; either way, every ON delivers a fresh edge.
How should the screen read the output's state back so the display stays in sync?
Read the state bit C20 as a coil rather than mirroring whatever the master last sent, because the local pushbutton changes the state too and the master's own copy drifts. The Y bit can be read the same way, but C20 is the state of record the logic decided on, so the display should follow the bit the output rung is driven from.
What happens when the SET and RST logic for a Y bit are true in the same scan?
The instruction solved later in the scan wins, because it executes last and leaves its value in the bit. If both conditions stayed true every scan, the bit would follow that later rung and a Modbus write would never survive. That is why the reset rung belongs after the set rung whenever the two conditions can coincide, so a stop overrides a start.
Can I skip the snapshot bit and compare C20 directly in both toggle rungs?
No. With immediate rung-by-rung updates, the SET rung writes C20 first and the RST rung, solved after it in the same scan, tests that new value and clears it again, so the output never moves. Reversing the rung order only inverts the failure. The snapshot C21, captured before any modification, is what leaves exactly one toggle rung true per pulse.
