8.3.5 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
Query
DisplayName Slave Address
Object Type
Value
•
Example Response
Response
DisplayName Slave Address
Object Type
Value
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 its 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.
Anybus Communicator PROFINET User Manual
1
2
Function
Byte Object
Byte Object
[SlaveAddress]
ID
The value of this byte
The value of this byte
constant will be set
constant will be set
using the "SlaveAd-
using the "Command
dress" parameter (see
ID"-field.
"Node Parameters" on
page 27).
1
2
Function
Byte Object
Byte Object
[SlaveAddress]
ID
This value is linked to
The value of this byte
the "SlaveAddress"
constant will be set
parameter in the
using the "Command
parameter window.
ID"-field.
3
4
Data
Checksum
Data Object
Checksum Object
User
User
The size and location
The checksum type etc
of the data associated
can be selected by the
with this object is
user. By default, this is
determined by the
set to match the Mod-
user.
bus-RTU standard.
3
4
Data
Checksum
Data Object
Checksum Object
User
Depend
The size and location
This object will retrieve
of the data associated
its settings from the
with this object is
corresponding object
determined by the
in the Query.
user.
Doc: HMSI-27-309, Rev. 3.11
Commands 45
Need help?
Do you have a question about the Anybus Communicator and is the answer not in the manual?
Questions and answers