www.accuenergy.comV: 1.05 Revised: June23Chapter 9 : Description of Modbus-TCP Protocol9.1.3 Function FieldThe function code field of a message frame contains eight bits. Valid codes are in the rangeof 1-255. When a message is sent from a client to a server device, the function code fieldtells the server what kinds of action to perform.Code Meaning Data1 Read Relay Output Status Obtain current status of Relay Output02 Read Digital Input (DI)Status Obtain current status of Digital Input03 Read Data Obtain current binary valuein one or more registers05 Control Single Relay Out-put Force Relay to a state of ON or OFF16 Write Multiple Registers Place specific value into a seriesof consecutive multiple registers9.1.4 Data FieldThe data field is constructed using sets of two hexadecimal digits, in the range of 00 to FF.The data field of messages sent from a master to slave contains additional informationwhich the slave must use to take the action defined by the function code. This can includeinformation such as the register addresses, the quantity of registers to query and the countof the actual number of data bytes. For example, if the master requests a slave to read agroup of holding registers(function code 03), the data field specifies the starting registerand how many registers are to be read.If the master needs to write data(function code 10 hexadecimal) to a group of registersin the slave, the data field specifies the starting register, how many registers to write, thecount of data bytes to follow in the data field and the data to be written into the registers.