To write a program you need to tell the PLC which input, output or memory location you mean. Every brand does this slightly differently, which confuses beginners. The good news: underneath, they all store the same kinds of data.
Bits, bytes and words
| Size | Bits | Range (unsigned / signed) | Typical use |
|---|---|---|---|
| Bit (BOOL) | 1 | 0 or 1 | An input, output, flag or contact |
| Byte | 8 | 0–255 | Groups of 8 inputs, characters |
| Word (INT) | 16 | 0–65,535 / −32,768–32,767 | Counts, analog values, timer presets |
| Double word (DINT) | 32 | about ±2.1 billion | Large counts, encoder positions |
| REAL (float) | 32 | decimals, e.g. 12.75 | Scaled measurements: bar, °C, litres |
Choose the smallest type that is always big enough. A production counter that might pass 32,767 in a long shift belongs in a DINT, not an INT. Overflowing an INT makes the number jump to −32,768, which has stopped many lines.
Number systems you will see
- Binary is how the PLC stores everything: 0000 0000 0000 0101 is 5.
- Hexadecimal is a short way to write binary, four bits per digit: 16#00FF is 255. Manufacturers write it as 16#FF, H0FF or 0xFF.
- BCD (binary-coded decimal) stores each decimal digit in four bits. You meet it with thumbwheel switches and seven-segment displays, and the PLC has BCD/BIN conversion instructions for it.
- Mitsubishi writes decimal constants as K (K50 = 50) and hex as H (H32 = 50).
How three brands name things
| Item | Mitsubishi FX | Siemens S7 | Allen-Bradley Logix |
|---|---|---|---|
| Digital input | X0, X1 … X7, X10 (octal) | I0.0 … I0.7, I1.0 | Local:1:I.Data.0, or a tag such as Start_PB |
| Digital output | Y0, Y1 … | Q0.0, Q0.1 … | Local:2:O.Data.0, or Motor_Run |
| Internal bit | M0, M1 … | M0.0 (memory bits) | Any BOOL tag |
| Timer | T0 … (with K preset) | IEC timer in a DB | TIMER tag |
| Counter | C0 … | IEC counter in a DB | COUNTER tag |
| Data word | D0, D1 … | MW10, DB1.DBW0 | INT/DINT tag |
Siemens addresses read as byte.bit: I0.3 is bit 3 of input byte 0. Mitsubishi FX numbers inputs and outputs in octal, so after X7 comes X10, there is no X8. Allen-Bradley Logix controllers are tag based: you create named variables and link them to physical I/O, so the program reads Start_PB rather than an address.
This course uses the short Mitsubishi style (X for inputs, Y for outputs, M for internal bits, T for timers, C for counters) because it is compact and easy to read. Everything you learn transfers directly to the other brands.
Internal bits: the PLC’s scratch paper
Internal bits (M bits, memory bits or BOOL tags) are not connected to any terminal. They behave like relays that exist only in memory: you can drive one with a coil and use its contacts as often as you like. Use them for machine states such as “Auto mode”, “Fault active” or “Step 3 running”. Choosing good names for them is the single biggest thing you can do to make programs readable.
Naming and documentation
- Give every input, output and internal bit a symbol and a comment: X0 START_PB “Start push button, panel door”.
- Keep an I/O list (a simple table of address, name, device and terminal). It is the first thing a technician asks for.
- Use the same names on the electrical drawings, in the program and on the HMI.
Frequently asked questions
Why does Mitsubishi skip X8 and X9?
FX-series inputs and outputs are numbered in octal (base 8), so the digits run 0–7. After X7 comes X10, after X17 comes X20.
What is the difference between INT and DINT?
INT is 16 bits (−32,768 to 32,767). DINT is 32 bits (about ±2.1 billion). Use DINT when a value can grow large, such as a production total.
