Ch3 modbus rtu master subroutine example – Rockwell Automation 1769-SM2 Compact I/O DSI/Modbus Communication Module User Manual
Page 98

6-18
MicroLogix 1500 Example Ladder Programs
CH3 Modbus RTU Master Subroutine Example
In Multi-Drive mode, any channel can be configured for Modbus RTU
Master operation. In the MicroLogix 1500 Multi-Drive ladder logic
example, CH3 is used to communicate with a PowerFlex 70 drive via
Modbus RTU operation.
Figure 6.7 Example MicroLogix 1500 Modbus RTU Ladder Logic CH3 Subroutine
1769-SM2 Channel 3 Modbus RTU Master Subroutine
Channel 3 consists of a single PowerFlex 70 drive with a 20-COMM-H adapter.
Write Logic Command and Reference.
N7:100 = Slave Address ("15" is the 20-COMM-H address)
N7:101 = Function Code ("16" is Write Multiple Registers command)
N7:102 = Starting Address ("0" = 4x0001)
N7:103 = Length ("3")
N7:104 = Logic Command word
N7:105 = MSW of 32-bit Reference
N7:106 = 16-bit Reference or LSW of 32-bit Reference
0000
B3:30
0
CH3
Write
Control
EN
DN
ER
MSG
Read/Write Message
MSG File
MG9:20
Setup Screen
MSG
Execute the control message continuously if the CH3 Write Control bit (B3:30/0) is ON.
0001
MG9:20
DN
Message
Done
MG9:20
ER
Message
Error
U
MG9:20
EN
Message
Enable
Read Logic Status and Feedback.
N7:110 = Slave Address ("15" is the 20-COMM-H address)
N7:111 = Function Code ("4" is Read Input Registers command)
N7:112 = Starting Address ("0" = 3x0001)
N7:113 = Length ("3")
The response data is stored in:
N7:114 = Logic Status word
N7:115 = MSW of 32-bit Feedback
N7:116 = 16-bit Feedback or LSW of 32-bit Feedback
0002
B3:30
1
CH3
Read
Status
EN
DN
ER
MSG
Read/Write Message
MSG File
MG9:21
Setup Screen
MSG
Execute the status message continuously if the CH3 Read Status bit (B3:30/1) is ON.
0003
MG9:21
DN
Message
Done
MG9:21
ER
Message
Error
U
MG9:21
EN
Message
Enable