
D301295 0513 - BL20 - Modbus RTUii
4 Implementation of Modbus TCP
4.1 Common Modbus description ....................................................................................................................... 4-2
4.1.1 Protocol description ............................................................................................................................................................................. 4-3
4.1.2 Data model............................................................................................................................................................................................... 4-4
4.2 Implemented Modbus functions ................................................................................................................... 4-6
4.3 Modbus registers ............................................................................................................................................ 4-7
4.4 Structure of the packed in-/ output process data ...................................................................................... 4-12
4.4.1 Packed input process data ...............................................................................................................................................................4-13
4.4.2 Packed output process data ............................................................................................................................................................4-13
4.5 Data width of the I/O-modules in the modbus-register area ....................................................................4-14
4.6 Register 0×100C: "Gateway status"............................................................................................................. 4-16
4.7 Register 0×113C und 0×113D: "Restore Modbus-Connection-Parameters" ........................................... 4-16
4.8 Register 0×113E und 0×113F: "Save Modbus-Connection-Parameters" ................................................. 4-17
4.9 The Service-Object........................................................................................................................................ 4-17
4.10 Bit areas: mapping of input-discrete- and coil-areas................................................................................. 4-20
4.11 Error behavior of outputs (watchdog) ........................................................................................................ 4-20
4.12 Parameters of the modules. ......................................................................................................................... 4-21
4.12.1 Digital input modules ........................................................................................................................................................................4-21
4.12.2 Analog input modules .......................................................................................................................................................................4-22
4.12.3 Analog output modules ....................................................................................................................................................................4-30
4.12.4 Technology modules..........................................................................................................................................................................4-35
4.13 Diagnostic messages of the modules.......................................................................................................... 4-45
4.13.1 Power distribution modules ............................................................................................................................................................4-45
4.13.2 Digital input modules ........................................................................................................................................................................4-46
4.13.3 Analog input modules .......................................................................................................................................................................4-46
4.13.4 Digital output modules .....................................................................................................................................................................4-49
4.13.5 Analog output modules ....................................................................................................................................................................4-51
4.13.6 Technology modules..........................................................................................................................................................................4-52
5 Application example: Modbus
5.1 Used hard-/ software ...................................................................................................................................... 5-2
5.1.1 Hardware .................................................................................................................................................................................................. 5-2
5.1.2 Software .................................................................................................................................................................................................... 5-2
5.2 Configuring the hardware.............................................................................................................................. 5-3
5.2.1 Connection of the BL20-gateway in the example ..................................................................................................................... 5-4
5.3 Operation with CoDeSys ................................................................................................................................ 5-5
5.3.1 Predefined feature sets........................................................................................................................................................................ 5-5
5.3.2 Creating a new project ........................................................................................................................................................................ 5-6
5.3.3 Defining the communication settings ........................................................................................................................................... 5-8
5.3.4 Adding the Modbus COM port ......................................................................................................................................................5-10
5.3.5 Adding the serial Modbus master .................................................................................................................................................5-12
5.3.6 Adding a Modbus-slave.....................................................................................................................................................................5-13
5.3.7 Programming (example program) ................................................................................................................................................5-16