Troubleshooting
Why a SCADA write to a PLC real address fails silently
Short answer
The link is usually fine. A SCADA write to a PLC REAL address fails over configuration: the ladder compares the double word as a DINT instead of REAL, the SCADA tag type does not match, raw-to-engineering scaling is not 1:1, or the key sequence is shorter than the entry format. Run the four checks in order and re-enter the value.
On this page
- Read the ladder comparison on the address first
- Match the tag data type to the PLC type
- Set the raw and engineering ranges to 1:1
- Worked example: the 10,000-to-1,000 scale that turns 0.20 into 2.0
- Make the key sequence fill the entry format
- Isolate the fault with an integer write
- Prove the write end to end
- Questions asked
A SCADA write to a PLC REAL address that changes nothing is almost never a communication fault. Reads on the same tag come back and no error dialog appears — the value dies in one of four configuration places: the ladder instruction that interprets the double word, the tag data type in the SCADA database, the raw-to-engineering scaling, and the key sequence behind the entry format. The signature is silence.
Run the checks in the order below, because each result changes what the next one means:
- Read the ladder comparison on the address: ==D expects a double integer, ==R expects a REAL.
- Match the tag data type to the type the ladder reads.
- Set the tag's raw and engineering ranges to 1:1.
- Make the key sequence fill every character of the entry format.
The worked example below uses the concrete case: Citect V5.50 writing 0.20 to VD332 in an S7-200 CPU 215 over COM1.
Read the ladder comparison on the address first #
VD332 is a four-byte V-memory double word, so it spans VB332, VB333, VB334 and VB335. Nothing in those bytes records a type: the instruction that reads them decides what they mean. Open the network that drives Q0.1 and read the comparison sitting on VD332.
A ==D or >=D comparison expects a double integer. A REAL bit pattern written into the double word reads back as a huge integer that satisfies nothing, so the output never picks up. The reverse fails too: a double integer read by ==R decodes as a denormal close to zero, so the REAL comparison never passes either. Both directions look exactly like a write that did nothing.
Prove the ladder from the programming side before touching SCADA. Add VD332 to a status chart, switch the display format to floating point, and write 15.0 from the programming software. If Q0.1 follows the comparison, the ladder is correct and the fault is on the SCADA side. If the ladder turns out wrong, the fix is an R-type instruction — ==R or >=R — with the constant written as a REAL: 15.0, not 15.
Silence is this fault's signature; question marks mean something different. A value field full of ? says the link is timing out, which Why HMI values show question marks: PLC comms timeouts covers as a fault of its own.
Decision: ==D on the address makes the ladder the fault — convert the comparison to ==R with a REAL constant. ==R already in place with 15.0 moves the search to the SCADA checks below.
Match the tag data type to the PLC type #
In the tag database — the file Variable.dbf in this Citect version — open the record for the tag (KETTLE_TEMP in the failing project) and read its data type field. A tag declared as a double or long integer pushes an integer bit pattern into the same four bytes the ladder reads as a REAL, so even a correct ==R network never sees 0.20. Set the type to the floating type the driver offers, and read the exact keyword from the software's own type list: this generation of packages spells it REAL or FLOAT, and the driver help decides which.
Confirm the address field next. It must use the driver's double-word syntax for V memory, taken from the driver documentation for the S7-200 protocol rather than reconstructed from memory. Then sweep the address map for overlap: VW334 is the upper word of VD332 and VB335 is its top byte, so a second tag assigned to either overwrites part of the REAL. Keep every other variable off VB332 through VB335.
If the ladder deliberately compares as a double integer, invert the fix: keep an integer tag type and write whole numbers only, because a DINT cannot store 0.20 at all. The type and the instruction must agree; anything else is a guaranteed silent failure.
Set the raw and engineering ranges to 1:1 #
Every numeric tag in the database carries a raw range and an engineering range, and the server converts on both reads and writes. The fields here are the Raw Zero/Full Scale pair and the Eng Zero/Full Scale pair, and the conversion is:
raw = RawZero + (engineering - EngZero) * (RawFull - RawZero) / (EngFull - EngZero)
Any mismatch between the two full scales multiplies or divides every value the operator types. The failing project held a raw full scale of 10,000 against an engineering full scale of 1,000 — a factor of ten inside every write. Set Raw Full Scale equal to Eng Full Scale and make the zeros equal as well; the value then passes through unchanged in both directions. The worked example below puts numbers on it.
Worked example: the 10,000-to-1,000 scale that turns 0.20 into 2.0 #
Inputs, with where each one comes from:
- Engineering value typed at the runtime: 0.20 — the setpoint from the failing case.
- Raw full scale: 10,000 counts — the tag's configured value in that case.
- Engineering full scale: 1,000 — the same tag's engineering range.
- Raw zero and engineering zero: 0 and 0 — assumed defaults; the case record does not show them, so substitute the real zeros if yours differ.
- Ladder threshold: 15.0 REAL, the ==R comparison driving Q0.1.
- Entry format: ####.#, one decimal place, from the page configuration.
Rule in words: before a write goes on the wire, the SCADA server converts the engineering value to raw counts with the formula from the previous section.
Arithmetic:
raw = 0 + (0.20 - 0) * (10,000 - 0) / (1,000 - 0)
= 0.20 * 10,000 / 1,000
= 2.0 counts
Result: VD332 receives a REAL 2.0 — ten times the value the operator typed.
Decision: 2.0 sits below the 15.0 threshold, so ==R stays false and Q0.1 never picks up. Set Raw Full Scale to 1,000 and repeat the arithmetic: 0.20 * (1,000 / 1,000) = 0.20 counts, the write lands, and the status chart reads 0.2. The output still waits for a typed value of 15.0 or above: with the scale fixed, entering 15.0 switches Q0.1 on and anything below 15.0 leaves it off.
Make the key sequence fill the entry format #
On a keypad entry, each # in the format string stands for one character position, decimal point included. A format of ####.# is six characters, so the key sequence must consume six positions before ENTER:
Format: ####.#
Key Sequence: ######ENTER
A shorter sequence ends the entry before the last digit commits, so the value the operator typed never matches the value the driver sent — another silent failure. Count decimal places the same way: ####.# carries one, so 0.20 cannot be typed exactly and commits as 0.2. A setpoint needing two decimals wants ####.##, seven characters, with #######ENTER.
Isolate the fault with an integer write #
When the checks disagree, or when even a long integer such as 15 refuses to write — which is how the case behind this article behaved before the fixes — separate the REAL path from the link path. Write an integer to an address the ladder genuinely reads as a DINT, with an integer tag type and the same key-sequence discipline.
A successful integer write clears the driver, the COM port and the address syntax, and puts the fault squarely in the REAL path: tag type, scaling or entry format. An integer write that fails while reads on the same port succeed points back at the tag database — address syntax or scaling — because a port that delivers reads is not the fault. Proving a serial read path end to end is its own procedure: Commissioning CP1L Host Link serial reads to SCADA walks one for a similar serial setup, and a genuine link drop should trip a state alarm built as in How to create a SCADA PLC communication alarm for link loss rather than fail silently.
Prove the write end to end #
With the ladder reading REAL, the tag typed REAL, the scales equal and the key sequence filling the format, run this sequence from the page:
- Enter 0.20 and watch VD332 in a status chart in floating-point format: it must read 0.2 — not 2.0, not a huge integer.
- Read the tag back on the page: the display must match what was typed, rounded to the format's decimal places.
- Enter a value that satisfies the comparison — 15.0 against the 15.0 constant: Q0.1 must pick up in the status chart and at the output terminal.
- Enter a value below the threshold: Q0.1 must drop out.
All four behaviors together prove the REAL write path from keypress to output terminal. What can still be wrong afterwards is the ladder constant itself, not the SCADA database.
Questions asked
Can the ladder keep ==D while the SCADA tag writes a REAL?
Not usefully. The driver stores the IEEE 754 bit pattern of the REAL in the four bytes, and a ==D comparison reads those bytes as a double integer, so it compares against a huge number instead of 15.0 and never passes. Either convert the ladder to ==R with a REAL constant, or keep ==D and change the tag to a double-integer type that writes whole numbers. Pick one interpretation per address and make both sides use it.
How small is a double integer 15 when the ladder reads it as REAL?
Force 15 into VD332 as a double integer, then switch the status chart to floating-point format: the bytes decode as a denormal of roughly 2 × 10⁻⁴⁴, effectively zero. Every ==R network compares against that zero and never passes. Seeing the value in the chart confirms the instruction type is the fault and clears the SCADA side of suspicion.
How do I tell what type is actually sitting in VD332?
Write a known 15.0 from the programming software, then flip the status chart display format for VD332. Floating point reads 15.0; signed double integer reads 1,097,859,072 from the identical bytes — the ten-digit number proves a REAL is stored where the ladder expects a DINT, or the reverse. One format switch settles the question faster than any rewiring.
What is the largest value the ####.# format accepts?
Four digit positions before the point and one after, so the ceiling is 9999.9 and the finest step is 0.1. For a bigger range, #####.## accepts 99,999.99 — eight characters, so the key sequence becomes ########ENTER. The rule scales: one # per position, and the count of positions before ENTER must equal the count of characters in the format.
The edits look right but the write still fails — what gets missed?
The runtime may still be running the old tag record. This SCADA package keeps its tag database in a file, Variable.dbf, so a change that was not saved — or a project that was not compiled after the save — leaves the old type, scaling and format in force. Save the database, compile the project, restart the runtime, then repeat the integer test write before touching the REAL path again.