Modbus general principles
Modbus is a communication protocol used for PLC networks. Historically, it was designed for communication on a serial interface (RS232, RS422,RS485) and supports since then the TCP mode.
OIBus offers a Modbus connector in TCP mode only.
In this TCP mode, Modbus sets up a client-server connection: the server provides data referenced by addresses but remains passive. It is the Modbus client that fetches the data values. The OIBus South Modbus connector is a Modbus client. It is therefore necessary to indicate to the connector:
host(IP address of the Modbus server machine)
port(502 by default)
slave idto identify the Modbus source machine if necessary.
Depending on the PLC, several settings are possible on how to access thedata. These settings are common to the whole PLC. They are the followingparameters:
Address offset: For most of the PLCs, there is no offset (Modbusoption). Some PLCs start the address range at 1 instead of 0, this isthe JBus option.
Endianness: Indicates the type of bit encoding (Big Endian or LittleEndian)
Swap Bytes: Indicates whether the bytes within a group of 16 bits (aword) should be inverted or not
Swap Words: Indicates whether the words (16-bit group) should beinverted or not within a 32-bit group.
The mode of addressing
Modbus data addresses follow the Modicon convention ConventionNotation (MCN):
Coil = [0x00001 - 0x09999]From 1 to 39,321
Discrete Input = [0x10001 - 0x19999]From 65,537 to 104,857
Input Register = [0x30001 - 0x39999]From 196,609 to 235,929
Holding Register = [0x40001 - 0x49999]From 262,145 to 301,465
An extended version of MCN allows the user to specify larger address spaces:
Coil = [0x000001 - 0x065535]
Discrete Input = [0x100001 - 0x165535]
Input Register = [0x300001 - 0x365535]
Holding Register = [0x400001 - 0x465535]
When adding a point in OIBus, it is necessary to specify several pieces of information:
point idcorresponds to the reference of the data for the target application (destination endpoint).
- The address corresponds to the address of the variable in the automaton, in hexadecimal without the data type digit. For example:
- For the data Holding
0x40001, you must enter the address
0x0001and specify the Modbus type holdingRegister.
- For the data Coil
0x009Cand specify the Modbus coil type.
scan modeindicates the time interval between two requests to the server.
data typeis used in the case of Holding Registers and Input Registers (otherwise the field is ignored). This parameter indicates the type of data retrieved from the register.