Modbus uses defined function codes in communications transactions for the type of information requested by the master, in addition to a specific data addresses (or range of addresses) that apply to the function code-defined request. Function codes are also used for verification in slave responses back to the master device. Example codes are “READ COIL STATUS” and “READ HOLDING REGISTERS”.
The Modbus protocol defines 24 different function codes. However, few devices support all function codes. A vendor’s documentation for a Modbus device should state which function codes are supported.
Function codes have associated numbers, used in Modbus messages. Table 2 shows in numerical order the function codes supported through the use of components in any NiagaraAX Modbus integration.
Table 2. NiagaraAX-supported Modbus function codes
| Code | Function Name | NiagaraAX Operation (JACE master) |
|---|---|---|
| 01 | READ COIL STATUS | Normal data polling of all read-only and writable Modbus proxy points. |
| 02 | READ INPUT STATUS | |
| 03 | READ HOLDING REGISTERS | |
| 04 | READ INPUT REGISTERS | |
| 05 | FORCE SINGLE COIL | Change of values at inputs and/or invoked actions of writable Modbus proxy points or client “preset” components. |
| 06 | PRESET SINGLE REGISTER | |
| 07 | READ EXCEPTION STATUS[a] | Poll device for exception status, output values and bits set. |
| 15 | FORCE MULITPLE COILS | Change of values at inputs and/or invoked actions of writable Modbus proxy points or client “preset” components. |
| 16 | PRESET MULTIPLE REGISTERS | |
| 20 | READ FILE RECORD | Using ModbusClientStringRecord to read and write file records, in which data is converted to ASCII characters and displayed as string. |
| 21 | WRITE FILE RECORD | |
|
[a] Modbus AX-3.5 or later (build 3.4.52 or higher) required. See About Modbus client exception status. |
||
If integrating a Modbus device that supports functions codes 15 or 16 (see Table 2), you can optionally choose to use these function codes instead of codes 05 and 06 by setting the corresponding Modbus Config
properties (in the Modbus network and/or device objects) from “false” value defaults. See Device-to-device differences for related details.
Copyright © 2000-2014 Tridium Inc. All rights reserved.