Modbus TCP Operations for AN-X4-AB-DHRIO Module
User Manual
Model: AN-X-DHP Firmware on AN-X4-AB-DHRIO Module
Module Overview
The AN-X4-AB-DHRIO module features ports for Power, Ethernet, and Network connectivity. It includes terminal blocks for power connections and status LEDs.
Introduction
Modbus TCP operations using the AN-X-DHP firmware on the AN-X4-AB-DHRIO module (referred to as AN-X) enable Modbus TCP clients to access PLC data on stations within a Data Highway Plus network. This functionality is available with AN-X-DHP firmware version 4.15.1 or higher.
Operation
Modbus TCP mappings facilitate the AN-X's ability to map Modbus TCP Unit/SlaveIDs to Data Highway Plus Stations. Modbus Input Registers (3xxxx) and Holding Registers (4xxxx) are subsequently mapped to PLC-5/SLC files for each station. The Modbus TCP server supports up to 128 concurrent connections.
Modbus Commands Supported
| Command | Register Type |
|---|---|
| 03 (03H) Read Holding Registers | 4xxxx |
| 04 (04H) Read Input Registers | 3xxxx |
| 06 (06H) Preset Single Register | 4xxxx |
| 16 (10H) Preset Multiple Registers | 4xxxx |
MS (Module Status) LED
The MS LED indicates the status of operations and errors within the AN-X operating system and software. The AN-X-DHP Modbus TCP Server introduces one additional MS LED error code.
Powerup/Reboot Status
| MS LED | Meaning |
|---|---|
| RED/7 | Modbus TCP server exited |
Configuration
Modbus TCP is configured using a text file. A sample configuration, illustrating the format and operation of the Modbus TCP server with several mapping examples, is available on the 'Modbus TCP View' page.
The configuration file uses the following structure:
Configuration File Structure
- Comments start with a semicolon (`;`).
- Radix can be overridden (e.g.,
0dfor decimal,0ofor octal,0xfor hex).
UnitID, PLC TYPE, and Station Mapping
UnitID [UnitID] [PLC TYPE] [Station] defines the mapping:
[UnitID]: Modbus Unit ID (decimal, 0-99).[PLC TYPE]: Specifies the PLC type (e.g.,PLC5orSLC). ForPLC5, file offsets are octal. ForSLC, file offsets are decimal. Refer to 'SLC I/O Mapping' for details.[Station]: Data Highway Plus Station (octal, 0-77).
Examples:
UnitID 70 PLC5 70: UnitID 70 mapped to a PLC-5 at Station 70 (octal).UnitID 01 SLC 01: UnitID 1 mapped to a SLC5/04 at Station 1 (octal).
Register Mapping (RegMap)
RegMap [UnitID] [ModbusReg] [AB Address] defines register mappings:
[UnitID]: Modbus Unit ID (decimal, 0-99).[ModbusReg]: Modbus Register address (e.g., 30001-39999 for Input Registers, 40001-49999 for Holding Registers). Extended ranges like 300001-365536 and 400001-465536 are also supported.[AB Address]: Allen-Bradley (AB) Address Range, typically in the formatI,O,B,N,F[FileNum]:[FileOfs]-[LastOfs].
Mapping Examples:
RegMap 70 400100 O0:0-37; PLC-5 Output file 0, offset 0-37 (octal).RegMap 70 300100 I1:0-37; PLC-5 Input file 1, offset 0-37 (octal).RegMap 70 403000 B03:0-999; PLC-5 Block transfer file 3, offset 0-999.RegMap 70 407000 N07:0-999; PLC-5 Control/Status file 7, offset 0-999.RegMap 70 310000 N10:0-999; 3xxxxx registers are read-only.RegMap 70 408000 F8:0-499; Floating point registers (F) occupy two words.RegMap 70 308000 F8:500-999; 3xxxxx floating point registers are read-only.RegMap 01 300100 O0:0-31; SLC Output file 0, offset 0-31 (decimal).RegMap 01 301000 I1:0-31; SLC Input file 1, offset 0-31 (decimal).RegMap 01 403000 B03:0-255; SLC Block transfer file 3, offset 0-255.RegMap 01 407000 N07:0-255; SLC Control/Status file 7, offset 0-255.RegMap 01 411000 N11:0-255; SLC file 11, offset 0-255.RegMap 01 408000 F08:0-255; SLC floating point registers (F) occupy two words.
SLC I/O Mapping Details
For AN-X Modbus, SLC I and O mappings specify the Module Slot Number in decimal, with Module Word Offset 0. I and O files must be accessed starting at Word Offset 0, with the required length. Data can be accessed consecutively as a block, potentially across multiple slots, but must always start at a valid Module Slot with Word Offset 0.
Example:
map RegMap 2 300100 I1:0-30 maps registers to slots in the SLC rack:
300100corresponds to slot 0.300101corresponds to slot 1.300102corresponds to slot 2.300130corresponds to slot 30.
To read I or O data for a module, use the starting register corresponding to the slot and then read the number of input or output registers for that module.
SLC Configuration Example:
- Slot 1: 1746-NIO4V (2 words in, 2 words out)
- Slot 2: 1746-NIO4V (2 words in, 2 words out)
- Slot 6: 1746-NT4 (8 words in, 8 words out)
Mapping Example:
RegMap 02 300100-300130 -> SLC 01 I001:000-030
This implies:
300100-> slot 0300101-> slot 1300102-> slot 2300106-> slot 6
To retrieve data:
- To get the 2 input words from slot 1, read 2 registers from 300101.
- To get the 2 input words from slot 2, read 2 registers from 300102.
- To get the 8 input words from slot 6, read 8 registers from 300106.
