PLC Data Types and Addressing Across Brands: Siemens, Allen-Bradley, Mitsubishi and CODESYS Side by Side

Why data types cause so many faults
A tag that overflows at 32,767 because somebody used INT for a totaliser. A REAL compared with equality that is never true. A word written into a bit address by mistake. A Modbus register mapped into the wrong half of a DINT. Most "strange" PLC behaviour comes from a data type or an address, and the rules differ just enough between brands to trip experienced people.
The core types
| Type | Size | Range | Use |
|---|---|---|---|
| BOOL | 1 bit | true/false | Contacts, coils, states |
| BYTE | 8 bits | 0 to 255 | Raw bytes, bit packing |
| INT | 16 bits signed | −32,768 to 32,767 | Analog raw values, counts |
| UINT / WORD | 16 bits | 0 to 65,535 | Modbus registers, status words |
| DINT | 32 bits signed | ±2.1 billion | Totalisers, encoder counts |
| REAL | 32-bit float | about 7 significant digits | Engineering values |
| LREAL | 64-bit float | about 15 digits | Precision maths, positions |
| TIME | 32 bits | ms | Timer presets |
| STRING | variable | text | HMI messages, recipes |
The rule that saves the most trouble: count in DINT, measure in REAL, never compare REALs for equality.

Siemens S7-1200 and S7-1500
- Types follow IEC names: Bool, Int, DInt, Real, LReal, Time, String, plus Word, DWord, Byte and the Char family.
- Addressing: I0.0, Q0.1, M10.3 for bits; IW64, QW80, MW20 for words; ID, QD, MD for double words. Data blocks are optimised (symbolic only) or standard (absolute DB1.DBW2).
- Analog inputs read 0 to 27,648 for 0 to 100 percent of range.
- Timers are IEC TON/TOF/TP instances in FBs, or the legacy S5 timers.
Allen-Bradley Logix (CompactLogix, ControlLogix)
- Types: BOOL, SINT, INT, DINT, REAL, STRING, plus TIMER, COUNTER and user-defined types (UDT).
- Addressing is tag based: no memory addresses. I/O appears as Local:1:I.Data.0 and structured module tags. The base integer is DINT, not INT; use DINT unless a device needs INT.
- Analog inputs are scaled in the module configuration to engineering units.
- Timers are structures with .PRE, .ACC, .DN, .TT, .EN.
Mitsubishi (GX Works2 and GX Works3)
- Devices: X inputs, Y outputs, M internal relays, D data registers, T timers, C counters, with octal numbering for X and Y on FX.
- Types: Bit, Word (16-bit signed), Double Word (32-bit), FLOAT (single precision), String. A 32-bit value occupies D100 and D101.
- Labels in GX Works3 add IEC-style names on top of devices.
CODESYS, Beckhoff, and the IEC reference
- Full IEC types including LINT, ULINT, LREAL, WSTRING, LTIME.
- %I, %Q, %M addressing with IEC syntax: %IX0.0 (bit), %IW2 (word), %MD4 (double word).
- Structures, arrays, enumerations and unions exactly as the standard defines.

Modbus and the 16-bit trap
Modbus registers are 16 bits. A 32-bit REAL or DINT spans two registers, and vendors disagree on word order (big-endian, little-endian, and byte-swapped variants). When a flow reads 1.4e-45 instead of 12.5, the word order is wrong. The Industrial Communication course has the four combinations to try.
Interview questions
- What happens when an INT totaliser passes 32,767? It wraps to −32,768.
- Why not compare REAL values with equality? Floating point representation; compare with a tolerance.
- Difference between WORD and INT? Same size; WORD is unsigned bit pattern, INT is signed number.
- Where is Siemens M memory versus a DB? M is bit memory; DBs are structured data with symbolic access.
Practise it
The TIA Portal, Studio 5000, GX Works3 and CODESYS courses each have a data types module; do the analog scaling exercise in two of them and the differences will stick.
Frequently asked questions
Should I use INT or DINT by default on Siemens? Int is native for I/O; DInt for counts and maths. On Rockwell, DINT always.
What is a UDT? A user-defined structure: a valve with .Open, .Closed, .Cmd, .Fault fields, instantiated for every valve.
How do I convert between types? With explicit conversion instructions (INT_TO_REAL, CONV, MOVE with conversion). Implicit conversion is where errors hide.

