I-7242D user manual
I-7242D DeviceNet/Modbus RTU Gateway User’s Manual, July 2006, Version 1.1 99/124
7.2.12 User-defined Modbus commands example
In “User-defined Modbus Command” class, the I-7242D supports three
instances for users who want to define their own Modbus messages. Users
can use the Master’s Explicit Message to set the 0x01 attribute and 0x03
attribute of this class. Please see the following steps.
Step 1:
Set 0x01 attribute value as the needed query Modbus command and
set 0x03 attribute value as the response Modbus command length.
Step 2
: Then set the 0x04 attribute value as a non-zero value. Thus the
I-7242D will send out the message according to 0x01 attribute to
Modbus devices.
Step 3:
The I-7242D will receive the response message from Modbus
devices and store the response message in 0x02 attribute.
Step 4:
After sending out the user-defined Modbus command, users can use
the Master’s Explicit Message to get the 0x02 attribute. And then the
response Modbus message will be returned to the Master.
In this example, we will use user-defined Modbus message to set Modbus
device (M-7017), see table 7-8. The request and response Modbus commands
are in the table 7-9 and table 7-10.
Table 7-8 User-defined function code (0x46): Read/Write Module Setting
Sub-function Code Description
00 (0x00)
Read the module name
Table 7-8 Request Modbus command message
00
Address
1 Byte 1 to 247
01
Function code
1 Byte 0x46
02
Sub function code 1 Byte 0x00
Table 7-9 Response Modbus command message
00
Address
1 Byte 1 to 247
01
Function code
1 Byte 0x46
02
Sub function code 1 Byte 0x00
03~06 Module name
4 Byte 0x00 0x70 0x17 0x00 for M-7017 serious
modules