Modbus Dynamic Mapping
Modbus dynamic mapping allows you to map any of the fixed register addresses to a new register address. By re-ordering the sequence block, read/write access of the re-mapped parameters becomes possible.
In general, all parameters are mapped as 32-bit values and occupy at least two Modbus registers. Parameters with a 64-bit data width occupy four Modbus registers. All 64-bit parameters are also mapped as 32-bit value (two registers) starting at register address 2000 (see Modbus 64-bit Parameters to 32-bit Mapping).
Configuring Dynamic Mapping
The start address for dynamically mapped registers is 8192 (0x2000).
Mapping works as follows:
- Enable dynamic mapping by writing a 1 (as a 32-bit value) to register address 4096 (0x1000). Writing a 1 enables the configuration mode of dynamic mapping. Writing a zero puts it into "run" mode, in which you can use the mapped parameter.
- The mapping is now register oriented. Next, write the valid fixed register address of the parameter you would like to map to an address starting at 8192. To map a 32-bit parameter, you must map the corresponding two registers.
Example
AOUT.VSCALE
Write 36 (hi-word) to address 8192 and 37 (lo-word) to address 8193.
The register oriented mapping allows you to optimize the data width for block transfers. To map a parameter with a data width of 16-bit, only the lo-word register needs to be mapped.
-
Example
MODBUS.DIO
Write 941 to address 8194
MODBUS.DIO fixed addresses are 940 (hi-word) and 941 (lo-word). Only the lo-word is of interest (16-bit value), because only the lo-word contains the actual value.
-
Disable dynamic mapping by writing a 0 (as a 32-bit value) to register address 4096 (0x1000). Disabling dynamic mapping puts it in a mode where you can now access the value of the mapped parameter and use the mapped register.
The fixed mapping starting at address 0 is still valid.
An example of the entire mapping process is included below:
Example
To re-map MODBUS.DIO (16-bit), MODBUS.DRVSTAT (16-bit), and DRV.MOTIONSTAT (32-bit):
- Enable dynamic mapping.
-
Block write transfer to address 0x2000 (8192).
Values: 941, 945, 268, 269
-
Modbus telegram:
Function: 0x10; Address: 0x20, 0x00; Number of Registers: 0x00, 0x04; Data Length in Byte: 0x08; Data: 0x03, 0xAD, 0x03, 0xB1, 0x01, 0x0C, 0x01, 0x0d
-
Disable dynamic mapping.
- Execute DRV.NVSAVE to store the mapping table non-volatile.
-
The re-mapped addresses are:
0x2000 : MODBUS.DIO
0x2001 : MODBUS.DRVSTAT
0x2002 : DRV.MOTIONSTAT (hi-word)
0x2003 : DRV.MOTIONSTAT (lo-word)
Saving and Resetting Dynamic Mapping
Use the following parameters to save and reset dynamic mapping:
- DRV.NVSAVE. Save parameters AND the dynamic mapping table non-volatile.
- DRV.RSTVAR. Set parameters to default value AND clear the dynamic mapping table.
Modbus Dynamic mapping through WorkBench Terminal
WorkBench provides an interface for configuring dynamic mapping. This allows you to save the dynamic mapping table in the WorkBench parameter file.
Modbus Overview
A value is identified through a register address and each register is a 16 bit word. To guarantee backwards compatability, each AKD parameter must have a fixed register address. However, the amount of registers needed to access a parameter depends on the parameter's data type. So if a parameter's data type is changed, the number of registers may change as well, which will result in different register addresses for all the following parameters. To avoid these register shifts, all parameters are mapped as either 32 bit words (2 registers) or 64 bit words (4 registers).
Modbus data is specified as big endian. A lower register address holds a higher rank of significance.
32 bit example:
Register address 0 → high 16 bit word
Register address 1 → low 16 bit word
Dynamic Mapping via Telnet
The following parameters can be set for dynamic mapping in WorkBench.
| Parameter | Function |
|---|---|
| MODBUS.DYNMAP1 | Enable dynamic mapping. |
| MODBUS.DYNMAP 0 | Disable dynamic mapping. |
| MODBUS.CLRDYNMAP | Clear dynamic mapping table. |
Map a complete parameter using register address. Map all registers from high to low.
Example:
PL.CMD (register address 570)
MODBUS.DYNMAP 1
MODBUS.CLRDYNMAP (optional)
MODBUS.ADDR8192 570
MODBUS.ADDR8193 571
MODBUS.ADDR8194 572
MODBUS.ADDR8195 573
...
MODBUS.DYNMAP 0
Map only the significant register from an 8 bit parameter. CAP0.EVENT, register address 58, is mapped as a 32 bit value. 58 is the high 16 bit word, and 59 is the low 16 bit word containing the parameter value. Only register 59 needs to be mapped:
MODBUS.ADDR8196 59
Scaling Parameters
You can scale parameters accessed through Modbus. This scaling is independent from the units of UNIT.PIN and UNIT.POUT. Instead, the user units are defined by MODBUS parameters:
- MODBUS.PIN (default = 1)
- MODBUS.POUT (default = 1)
- MODBUS.PSCALE (default = 20)
With the default settings shown above, the units are as follows:
- Position [counts (PSCALE bit per revolution)]
- Velocity [counts/sec]
- Acceleration / Deceleration [counts/sec2]
- Current (Torque) [mA]
Modbus scaling example
If MODBUS.PSCALE = 20 then all position information is 20 bits.
POSITION = 2^20 COUNTS/revolution
VELOCITY = 2^20 COUNTS/SEC
ACC/DEC = 2^20/SEC^2
This means that there will be 2^20 or 1,048,576 position units per revolution. This affects all parameters (velocity is in position units/sec, accel and decel are in position units/sec^2)
-
-
With 20 bits per revolution, and 32 bits of data available, you can have 32 bits-20 bits = 12 bits of revolutions (4096 revolutions) before the 32 bit data is full and goes negative.
The other scaling factors in Modbus are MODBUS.PIN and MODBUS.POUT.
MODBUS.PIN and MODBUS.POUT are the scaling ratio to help relate the Modbus position resolution to the drive position units resolution (or simply scale Modbus User Units). It allows you to work in user units through Modbus.
For example, if you set up the drive user units to be 10,000 counts/revolution:
UNIT.PIN = 10,000
UNIT.POUT = 1
Then to have Modbus reflect the same units, set up the Modbus units:
MODBUS.PIN = 2^MODBUS.PSCALE = 1,048,576
MODBUS.POUT = UNIT.PIN/UNIT.POUT * 1,000 = 10,000,000
'use this also to account for the lack of a decimal point in Modbus data
Then in Modbus:
Counts/revolution = 10,000
' In Modbus you would read 10,000,000 but the data represents 10,000.000 since Modbus shows only integers.
Modbus specific registers (Parameters)
The following parameters provide a shortcut to digital I/O, status information, and commands.
| Parameter | Bit |
|---|---|
| MODBUS.DIO |
Bit 0 to 6: DIN.STATES Bit 16 and 17: DOUT.STATES |
| MODBUS.DRVSTAT |
Parameters collected: Bit 0: DRV.ACTIVE (drive active) Bit 1: STO.STATUS (STO status) Bit 2: HWLS.POSSTATE (positive HW limit) Bit 3: HWLS.NEGSTATE (negative HW limit) Bit 4: SWLS.STATE (positive SW limit) Bit 5: SWLS.STATE (negative SW limit) |
| MODBUS.DRV |
Bit 0: DRV.STOP (write 1 to execute) Bit 1: DRV.EN (write 1 to enable drive) and DRV.DIS (write 0 to disable drive) |
| MODBUS.HOME |
Bit 0: HOME.MOVE (write 1 to execute) Bit 1: HOME.SET (write 1 to execute) |
| MODBUS.MOTOR |
Bit 0: MOTOR.BRAKE Bit 1: MOTOR.BRAKERLS |
| MODBUS.MT |
Bit 0: MT.CLEAR number from MT.NUM Bit 1: MT.CONTINUE Bit 2: MT.LOAD number from MT.NUM Bit 3: MT.SET Bit 4: MT.MOVE (number from MT.NUM) Note: when both bit 2 and 4 are set then MT.SET is executed first and MT.MOVE second to start the motion task. |
| MODBUS.SM |
Bit 0: One direction (sets SM.MODE to either 0 or 1) Bit 1: Start move Edge-triggered:
|
32-bit versus 16-bit Values
Modbus mirrors all parameters either as 32-bit or 64-bit values. The minimum data width of 32-bit supports backward compatibility, which means that if the internal data width changes, this change has no effect on the register address of consecutive parameters. Dynamic mapping allows you to map only the registers that are relevant to the application and thus reduces communication overhead.
Mapping of 64-bit Parameters to 32-bit Parameters
All 64-bit parameters are mapped as 32-bit parameters starting at register address 2000. Only the 32-bit lo-word is mapped with the same scaling as the 64-bit parameter. Chapter 7 contains the general mapping table (chapter 7.2) and the 64-bit to 32-bit mapping table (chapter 7.3).
Fault Registers
Fault registers MODBUS.FAULT1 (register address 954) to MODBUS.FAULT10 (register address 972) contain the fault state of the drive.
You can obtain the current fault state as follows:
- Read MODBUS.FAULT1.
- If MODBUS.FAULT1 is zero, then the drive is fault free.
- A nonzero value of MODBUS.FAULT1 is a fault number.
- If MODBUS.FAULT1 is nonzero, the following fault registers (MODBUS.FAULT2 to MODBUS.FAULT10) contain possible further fault numbers.
- A value of zero indicates no further faults
Mapping Table
The tables below show Modbus addresses and attributes. The attributes are described as follows:
| Attribute |
Description |
|---|---|
| 64-bit Parameter | Parameter is internally a 64-bit parameter. |
| 8-bit, 16-bit, 32-bit | Internal data size, mapped as 32-bit (2 registers). |
| 64-bit | Internal data size, mapped as 64-bit (4 registers). |
| Low 32 bit word | Internally a 64-bit value, only the low 32-bit word is mapped (2 registers). |
| Signed |
Sign bit is significant (negative/positive values are accepted). |
| Command | Executes a command. |
| Command, data width | Executes a command with numerical argument (for example, MT.NUM). |




