
Contents
4
Chapter 9 Modbus Communication
9.1 General ------------------------------------------------------------------------------------------------------------------------------------------- 9-1
9.1.1 Procedure of Modbus communication ---------------------------------------------------------------------------------------- 9-1
9.2 Modbus Protocol ------------------------------------------------------------------------------------------------------------------------------- 9-1
9.2.1 Kind of Modbus protocol ------------------------------------------------------------------------------------------------------------ 9-1
9.2.2 Structure of Modbus protocol ------------------------------------------------------------------------------------------------------ 9-2
9.3 Frame Structure -------------------------------------------------------------------------------------------------------------------------------- 9-3
9.3.1 Frane structure in the ASCII mode --------------------------------------------------------------------------------------------- 9-3
9.3.2 Frame structure in the RTU mode ---------------------------------------------------------------------------------------------- 9-3
9.3.3 Data and expression of address ------------------------------------------------------------------------------------------------ 9-4
9.3.4 Reading data of bit type at the bit output (01) ------------------------------------------------------------------------------- 9-4
9.3.5 Read Input Status (02) ------------------------------------------------------------------------------------------------------------- 9-6
9.3.6 Read Holding Registers (03) ----------------------------------------------------------------------------------------------------- 9-7
9.3.7 Read Input Registers (04) --------------------------------------------------------------------------------------------------------- 9-8
9.3.8 Force Single Coil (05) -------------------------------------------------------------------------------------------------------------- 9-9
9.3.9 Preset Single Register (06) ------------------------------------------------------------------------------------------------------9-10
9.3.10 Force Multiple Coils (0F) ------------------------------------------------------------------------------------------------------- 9-11
9.3.11 Preset Multiple Registers (10) ------------------------------------------------------------------------------------------------ 9-13
9.4 Modbus Server ------------------------------------------------------------------------------------------------------------------------------- 9-15
9.4.1 Setting when CPU is XGK series and Cnet acts as ASCII server
------------------------------------------------- 9-15
9.4.2 Setting when CPU is XGI/R series and Cnet acts as ASCII server ------------------------------------------------ 9-18
9.4.3 Setting when CPU is XGK series and Cnet acts as Modbus RTU server --------------------------------------- 9-21
9.4.4 Setting when CPU is XGI/R series and Cnet acts as Modbus RTU server ------------------------------------- 9-24
9.5 Modbus RTU/ASCII Client --------------------------------------------------------------------------------------------------------------- 9-27
9.5.1 Standard settings in case of Modbus client ------------------------------------------------------------------------------- 9-27
9.5.2 Settings in case of Modbus RTU/ASCII client ---------------------------------------------------------------------------- 9-29
9.5.3 Writing the parameter
------------------------------------------------------------------------------------------------------------ 9-31
9.6 Frame Monitor ------------------------------------------------------------------------------------------------------------------------------- 9-32
Chapter 10 User-defined Communication
10.1 General -------------------------------------------------------------------------------------------------------------------------------------- 10-1
10.1.1 Procedure of user-defined communication ------------------------------------------------------------------------------ 10-1
10.2 Structure of user definition frame ---------------------------------------------------------------------------------------------------- 10-2
10.2.1 Structure of HEAD -------------------------------------------------------------------------------------------------------------- 10-2
10.2.2 Structure of TAIL ----------------------------------------------------------------------------------------------------------------- 10-2
10.2.3 Structure of BODY -------------------------------------------------------------------------------------------------------------- 10-3
10.3 Writing of frame ---------------------------------------------------------------------------------------------------------------------------- 10-4
10.3.1 Standard setting for user-defined communication--------------------------------------------------------------------- 10-4
10.3.2 Writing transmission frame --------------------------------------------------------------------------------------------------- 10-6
10.3.3 Writing reception frame -------------------------------------------------------------------------------------------------------- 10-8
10.3.4 Setting parameter ------------------------------------------------------------------------------------------------------------- 10-10
10.3.5 Writing parameter -------------------------------------------------------------------------------------------------------------- 10-11
10.4 Frame Monitor ---------------------------------------------------------------------------------------------------------------------------- 10-12
10.5 UDATAInstruction ----------------------------------------------------------------------------------------------------------------------- 10-13
10.5.1 XGI Instruction ------------------------------------------------------------------------------------------------------------------ 10-13
10.5.2 XGK Instruction ----------------------------------------------------------------------------------------------------------------- 10-18