MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How do expansion module addresses map to the addresses used in the program?
HomeModels
Table of contents

On this page

PLC & Programming (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How do expansion module addresses map to the addresses used in the program?

Once an expansion module is fitted, a fixed rule connects the address used in the program with the module's physical position. Lose track of that rule and you get "the module is clearly plugged in but the program cannot read it", or an address range shifted by one place. The sections below set out the relationship between physical position, start address and program address.

1. Two views of an address: physical slot and logical address

The physical view asks which slot the module occupies and what type it is; the logical view asks how the program addresses it. An allocation rule links the two: each slot corresponds to a block of addresses, and the module type decides whether that block is organised by bit or by channel. The address written in the program is the logical one; it carries no memory of which slot the module sits in and simply reads the physical location the rule points to. The heart of the matter is therefore the slot-to-address conversion.

2. Fixed addresses versus automatic allocation

Two approaches exist. With fixed addresses, each slot maps to a preset range, so swapping the module does not change the range and the program needs no edit. With automatic allocation, the controller assigns addresses module by module in order and by type, so change the slot order and every module downstream shifts. The first is convenient for porting, while the second is more flexible but demands care on insertion and removal: after any change the addresses must be rechecked.

3. How slots correspond to start addresses

The usual rule is that the built-in I/O of the base unit occupies a block of base addresses, and expansion modules start at a defined point and accumulate upwards by point count or channel count. Digital modules occupy a number of bits or bytes according to their point count; analog modules occupy a number of words according to their channel count. Note that "occupying by point count" is not the same as "occupying whole bytes": some families pad a partial byte up to a byte boundary, which leaves a gap between the start address of one module and the next. When checking addresses, read the family's allocation rule first and then accumulate module by module.

4. Working out an analog module's address

An analog channel normally corresponds to one word, or a double word. Take a typical module: if the expansion block starts at a given number, channel 1 corresponds to the start word, channel 2 to the start word plus one, and so on. If the module is an analog input, the program reads on that pattern; if it is an analog output, the program writes on the same pattern. With mixed modules, the word count of each module must be accumulated separately rather than treating inputs and outputs as one pool.

5. What changes when a slot or module is altered

On families using automatic allocation, moving a module's slot or inserting a new one shifts the start address of every module downstream. So export a program backup and record the original allocation before the change, then verify online afterwards that each module's address still matches its reference in the program. The step most often overlooked is inserting a small module in the middle: it occupies little address space itself, yet pushes the whole row of modules behind it along, and the program misses on every one of them unless it is edited.

6. Module position and program address

Module positionPhysical slotStart address (indicative)How the program addresses it
Built-in inputsSlot 0, internalStart of the base input blockBit addressing with offset
Built-in outputsSlot 0, internalStart of the base output blockBit addressing with offset
First digital input moduleExpansion slot 1Start of the expansion blockBit addressing, by point count
Second digital output moduleExpansion slot 2After the previous moduleBit addressing, by point count
Third analog input moduleExpansion slot 3Accumulated from the modules beforeWord read per channel
Fourth analog output moduleExpansion slot 4Accumulated from the modules beforeWord write per channel
Special function moduleExpansion slot 5 onwardsIts own block by typeFunction block or dedicated registers
Remote I/O stationSeparate stationBlock assigned by station numberStation number plus module number
High-speed counter moduleExpansion slot nFixed channel blockCount value read by function block
Communication moduleExpansion slot nOccupies no I/O address blockCommunication instructions or data area

7. Notes

The most practical defence against address displacement is a "module position to address" table kept alongside the I/O allocation table and updated whenever a module is added or removed. Using symbolic names in the program rather than hard-coded addresses also confines the fallout of a slot change to one place. Where the family supports automatic allocation, fix the module order in the hardware configuration and discourage casual plugging and unplugging, which is what causes large-scale displacement when someone adjusts a rack on site.

8. References

The I/O requirements and electrical characteristics of PLC equipment follow GB/T 15969.2 (IEC 61131-2). Programming languages, variables and addressing methods follow GB/T 15969.3 (IEC 61131-3). The specific allocation rules, slot definitions and module address blocks of a family are as stated in its hardware manual; the items listed here illustrate the conversion.

9. Points to watch

⚠️ Three common traps:
(1) Programming on the intuition that the third slot means the third address block, ignoring module type and width, so the addresses are displaced from the middle outwards;
(2) Inserting a small module in the middle of an expansion chain, shifting every downstream address while the program is left unedited, so a whole section of logic stops working;
(3) Accumulating digital and analog modules at the same width when they are mixed, so the analog channels all shift and the values read come from the neighbouring channel.

Fitting, removing or swapping modules requires the machine to be isolated, proved dead and locked off; after the change, verify each module's address against its reference in the program online before returning to service.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL