4 How to Control4.1 How to Control the FrequencyConverterThis section describes codes which can be used in thefunction and data fields of a Modbus TCP message. For acomplete description of all the message fields, refer to4.2 Modbus TCP Message Framing Structure.4.1.1 Function Codes Supported byModbus TCPModbus TCP supports use of the following function codesin the function field of a messageFunction Function codeRead holding registers 3 hexWrite single register 6 hexWrite multiple registers 10 hexGet comm. event counter B hexReport slave ID 11 hexRead/Write multiple registers 17 hexTable 4.1 Function CodesFunction FunctioncodeSub-functioncodeSub-functionDiagnostics 81 Restart communication2 Return diagnosticregister10 Clear counters anddiagnostic register11 Return bus messagecount12 Return bus communi-cation error count13 Return bus exceptionerror count14 Return slave messagecountTable 4.2 Subfunction Codes4.2 Modbus TCP Message FramingStructure4.2.1 Function CodeThe function code of a message frame contains 8 bits.Valid codes are in the range of 1-FF. Use function codes tosend messages between master and slave. When amessage is sent from a master to a slave device, thefunction code tells the slave what action to perform. Whenthe slave responds to the master, it uses the function codeto indicate either a normal (error-free) response, or thatsome error occurred (called an exception response). For anormal response, the slave echoes the original functioncode. For an exception response, the slave returns a codethat is equivalent to the original function code with itsmost significant bit set to logic 1. In addition, the slaveplaces a unique code into the data field of the responsemessage. This tells the master what error occurred, or thereason for the exception. Refer also to sections4.1.1 Function Codes Supported by Modbus TCP and4.2.9 Modbus Exception Codes.4.2.2 Data FieldThe data field is constructed using sets of two hexadecimaldigits, in the range of 00 to FF hexadecimal. These digitsare made up of one TCP character. The data field ofmessages sent from a master to slave device containsadditional information which the slave must use to takethe action defined by the function code. This can includeitems such as coil or register addresses, the quantity ofitems to be handled, and the count of actual data bytes inthe field.4.2.3 Parameter HandlingThe PNU (Parameter Number) is translated from theregister address contained in the Modbus read or writemessage. The parameter number is translated to Modbusas (10 x parameter number) DECIMAL. Example: Reading3-12 Catch up/slow Down Value (16bit): The holding register3120 holds the parameters value. A value of 1352(Decimal), means that the parameter is set to 12.52%Reading 3-14 Preset Relative Reference (32bit): The holdingregisters 3410 & 3411 holds the parameters value. A valueof 11300 (Decimal), means that the parameter is set to1113.00 S.For information on the parameters, size and convertingindex, consult the product relevant programming guide.4.2.4 Storage of DataThe Coil 65 decimal determines whether data written tothe frequency converter are stored in EEPROM and RAM(coil 65=1) or only in RAM (coil 65= 0).How to Control MCA 122 Modbus TCPMG90P202 - VLT® is a protected Danfoss trademark 174 4