Commands
8-6
Example: Specifying a Modbus-RTU Command in Master Mode
In the following example, a Modbus-RTU command is created in Master Mode. In Modbus-RTU, a
transaction always feature the following parts:
• Slave Address (1 byte)
• Function Code (1 bytes)
• A data field
• CRC (CRC-16)
Furthermore, each command always consists of a Query and a Response.
• Example Query
• Example Response
By default, the Modbus-RTU-specific frame objects are already in place, and a data object is inserted
between the function code and the CRC. These objects cannot be moved or deleted, however it is pos-
sible to add additional objects between the function code and the CRC as desired.
Name the new command by entering it’s name in the ‘Command Name’-field, and enter a suitable func-
tion code in the ‘Command ID’-field. If the command is allowed to be broadcasted, check the ‘Allow
Broadcasting’-checkbox.
Query
1
2
3
4
DisplayName Slave Address
Function
Data
Checksum
Object Type
Byte Object
Byte Object
Data Object
Checksum Object
Value
[SlaveAddress]
ID
User
User
The value of this byte
constant will be set
using the ‘SlaveAd-
dress’ parameter (see
5-1 “Node Parame-
ters”).
The value of this byte
constant will be set
using the ‘Command
ID’-field.
The size and location
of the data associated
with this object is
determined by the
user.
The checksum type
etc can be selected by
the user. By default,
this is set to match the
Modbus-RTU stan-
dard.
Response
1
2
3
4
DisplayName Slave Address
Function
Data
Checksum
Object Type
Byte Object
Byte Object
Data Object
Checksum Object
Value
[SlaveAddress]
ID
User
Depend
This value is linked to
the ‘SlaveAddress’
parameter in the
parameter window.
The value of this byte
constant will be set
using the ‘Command
ID’-field.
The size and location
of the data associated
with this object is
determined by the
user.
This object will
retrieve its settings
from the correspond-
ing object in the
Query.