Explainer
CP1L ladder operand prefixes and address notation
Short answer
In CX-Programmer, a bare number in a CP1L operand is a CIO word address, not a constant: &1 is an unsigned integer constant, +1 a signed integer, +1.0 a floating-point value and #1 hexadecimal. The rung FLT 1 W8 therefore converts the signed integer in CIO word 1 into a 32-bit REAL that occupies Work Area words W8 and W9 — read every operand's prefix before trusting the arithmetic.
On this page
- What does a bare number mean in a CP1L ladder operand?
- How do I write a constant instead of an address?
- What does the rung FLT 1 W8 actually do?
- Why does a REAL result need two words in the Work Area?
- Which word is my analog input on a CP1L?
- Which arithmetic instruction matches the data I stored?
- How do I prove the conversion before it drives the valve?
- Questions asked
The character in front of the number decides whether a CP1L rung reads memory or uses a value. In CX-Programmer notation, a bare number such as 1 names CIO word 1, an address in the input and output data area, while &1, +1, +1.0 and #1 are constants in unsigned integer, signed integer, floating-point and hexadecimal form. Read that way, the rung FLT 1 W8 says exactly what it does: take the signed integer held in CIO word 1, convert it to a 32-bit REAL, and store the result in the Work Area across W8 and W9. This article walks through the constant prefixes, the two-word REAL storage, the CP1L memory areas, the arithmetic instructions that must match the stored data type, and the bench check that proves the conversion before any rung drives a proportional valve.
What does a bare number mean in a CP1L ladder operand? #
It is an address, not a value: in CX-Programmer notation a bare number such as 1 names CIO word 1, the input and output data area, so the instruction reads a word of memory instead of using the constant one.
That is the trap in classroom and lab programs: a rung that looks like it uses the number 1 is sampling whatever hardware or earlier logic wrote into CIO word 1. The CX-Programmer operation manual treats PLC addresses as the operands of the program, and Omron's instructions reference manual gives constants in CX-Programmer notation, with numeric values stated in decimal with an & prefix. The notation therefore splits cleanly: no prefix means an address, a prefix means a constant. Read every prefix-less operand as an address and ask what fills that word before you trust the calculation it feeds.
How do I write a constant instead of an address? #
Add the prefix that names the data type: &1 is an unsigned integer constant, +1 a signed integer constant, +1.0 a floating-point constant and #1 a hexadecimal constant, while a number without any prefix stays a CIO word address.
| Operand | What the instruction receives | Typical use in a calculation rung |
|---|---|---|
1 |
the content of CIO word 1, an address | sampling an input word or a staged result |
&1 |
unsigned 16-bit integer constant, 0 to 65535 | raw counts and positive scaling factors |
+1 |
signed 16-bit integer constant, -32768 to 32767 | offsets and values that may go negative |
+1.0 |
32-bit floating-point constant, a REAL | engineering units and calibration factors |
#1 |
hexadecimal constant, a raw bit pattern | masks and status words |
The + prefix does not mean the value is positive; it selects the two's-complement signed interpretation of the 16 bits, so the same word reads as 65535 unsigned or -1 signed. That signed-versus-unsigned reading is the same decision covered by converting an unsigned 16-bit Modbus word to a signed integer. Pick the prefix from the data type the instruction expects, not from how the number looks on the drawing.
What does the rung FLT 1 W8 actually do? #
It reads the 16-bit signed integer held in CIO word 1, converts it to a 32-bit floating-point REAL and stores that REAL across Work Area words W8 and W9; it touches neither the constant 1 nor CIO word 0.
Worked example: stage the valve command in hundredths of volts, so CIO word 1 holds the signed integer +630, meaning 6.30 V. The rung converts 630 into the REAL 630.0, whose 32-bit IEEE 754 single-precision pattern is 0x441D8000, stored across W8 and W9. The next rung, *F W8 +0.01 W10, multiplies REALs: 630.0 × 0.01 = 6.3, so W10 and W11 hold the REAL command 6.3 V with pattern 0x40C9999A. A watch set to a real-number format shows +6.3; the pattern ends in 999A because 6.3 has no exact binary fraction, which is normal for single precision.
Two details matter at the source. FLT treats the source word as signed, so a raw channel value above 32767 arrives as a negative number and needs unsigned handling before conversion. And whether CIO word 1 is really your analog channel is a hardware question the prefixes cannot answer.
Why does a REAL result need two words in the Work Area? #
A REAL is 32 bits, so it fills two consecutive 16-bit words wherever it lives; any other allocation that touches either of those words silently corrupts the value, so reserve non-overlapping pairs for every floating-point result.
Two consequences follow. Copy the pair as a pair: MOVL moves both 16-bit halves in one rung, while two separate MOV rungs leave a window in which the value is half old and half new. Keep allocations apart: a second REAL parked at W7 would span W7 and W8 and overwrite the low half of the conversion result without any error message. The same two-word reality is why a SCADA write to a PLC real address fails silently when only one of the halves reaches the controller. Budget every floating-point value as two words, write the allocation down, and let no other rung touch either word of the pair.
Which word is my analog input on a CP1L? #
On a CP1L the built-in input words begin at CIO 0 and the output words begin at CIO 100, with the Work Area kept apart for calculations, so a bare 1 reads input word 1 and expansion analog units take the words the I/O allocation assigns.
The CP1L operation manual lays the areas out in its I/O Memory Allocation section: the input and output areas hold the built-in and expansion I/O, and how many words each consumes depends on the CPU model and the expansion units connected, with CX-Programmer showing the allocation for the configured system. The Work Area is a separate block the system leaves alone, which is why calculation results conventionally live in W words. A bare 1 as the force-cell input therefore deserves a second look: the built-in digital inputs occupy the very start of the input area, and an analog expansion unit lands on whatever words the allocation gives it. Open the allocation, find the word your channel uses, and give it a symbol name and a units comment. Scaling that raw word into engineering units is the same job as scaling a 4-20 mA analog input to engineering units in CPM2 ladder, only with CX-Programmer's prefixes on the operands.
Which arithmetic instruction matches the data I stored? #
Match the suffix to the stored representation: * multiplies two signed 16-bit integers, *L and *UL take 32-bit signed and unsigned operands, *F multiplies REALs, and MOV or MOVL only copies bit patterns, it never converts one representation into another.
| Instruction | Operands it expects | What it writes back |
|---|---|---|
* |
two signed 16-bit integers | 32-bit signed result, two words |
*L |
two signed 32-bit integers | 64-bit signed result, four words |
*U |
two unsigned 16-bit integers | 32-bit unsigned result, two words |
*UL |
two unsigned 32-bit integers | 64-bit unsigned result, four words |
*F, /F |
two 32-bit REALs | 32-bit REAL result; a zero divisor sets the error flag |
MOV |
one word | the same 16 bits, unchanged |
MOVL |
two consecutive words | the same 32 bits, unchanged |
FLT |
one signed 16-bit integer | the REAL value, two words |
FIX |
one 32-bit REAL | a signed 16-bit integer, fraction dropped |
The suffixes exist because bits carry no type of their own: the same 16 bits are a raw count, a negative number or a hex mask depending on the instruction that reads them. Choose one representation at the calculation boundary: convert the raw integer once with FLT, do the pressure and voltage arithmetic in REAL, and convert back with FIX only when a word-oriented destination such as an analog output card needs an integer. Pick the mnemonic whose suffix matches the data you stored, and never move bits with MOV and expect them to mean something new.
How do I prove the conversion before it drives the valve? #
Go online, force a known integer into the source word, and watch both sides with the right display format: the raw word as unsigned or signed decimal, the destination pair as a REAL, and accept the rung only when the watched REAL equals the conversion you computed by hand.
With the worked example, force &630 into the source word, put the source and the destination pairs W8-W9 and W10-W11 in the watch list, set the pairs to a real-number display, and expect +6.3 after the scale rung. A huge unsigned number on the watch means the pair is being read as integers: the display format is wrong, not the rung. Keep the proportional valve out of the loop while you do this: leave the output word unwritten or clamped so a wrong operand cannot move the actuator. No rung feeds hardware until the watched REAL matches the hand calculation.
Questions asked
Why does CX-Programmer reject a decimal constant in a MOV operand?
MOV transfers one raw word, so its constant operand must be a 16-bit value entered with the & unsigned, + signed or # hexadecimal prefix. A value with a decimal point is a REAL and belongs in floating-point instructions such as *F or /F. The operand type is checked when the rung is edited and compiled, so a mismatch is caught before the program reaches the PLC.
How do I check which unit version my CP1L runs before following the manual?
Connect to the CPU and read the PLC information in CX-Programmer: version 7.1 or higher can confirm the unit version that way, and the CP-series programming manual explains how unit versions are marked on the products. Instruction behavior is documented per unit version, so match the manual copy to the version you read before relying on the operand details.
What happens if a CP1L calculation overflows its data type?
The arithmetic instructions signal overflow with flags instead of stopping the scan: a /F rung with a zero divisor sets the error flag and skips the operation, and FIX reports an out-of-range REAL on the carry flag when the value does not fit a signed 16-bit integer. Check the flags in any rung that can overflow, and clamp the result before it reaches an output word.