This article demonstrates how to set up Modbus RTU communication between a Siemens S7-1200 PLC and a T6 driver.
- Hardware:
- S7-1200 PLC: CPU 1215C DC/DC/DC
- CM1241: RS422/485
- T6: T6-1000RS, T6M80-1000H2A3-M17S
- 24V power supply: S-150-24
- Overview:
The S7-1200 PLC acts as the Modbus RTU master, and the T6 driver acts as the Modbus slave. The PLC reads the motor position parameter from the T6 driver.
- Implementation Steps:
- Step 1: Configure T6 driver parameters
| Parameter | Setting |
|---|---|
| Pr5.29 = 4 | Parity: None, Data bits: 8, Stop bits: 1 |
| Pr5.30 = 6 | Baud rate: 115200 |
| Pr5.31 = 1 | RS485 slave address: 1 |
- Step 2: Configure the Modbus RTU communication module

- Step 3: Enable system memory
In the project tree, select PLC_1 and right-click to open Properties. In the properties window, navigate to System and Clock Memory and check the box for Enable System Memory Bytes.

- Step 4: Call the MB_COMM_LOAD instruction
Open the Main [OB1] block. Navigate to Instructions → Communication → Communication Processor → Modbus, and drag the MB_COMM_LOAD instruction into the program segment as shown below.

- Step 5: Create data send and receive buffer areas
In the project tree, select Add New Block → Data block (DB) → OK, as shown below. After adding the new block, disable the Optimized Block Access option and define the data send and receive buffer arrays.

- Step 6: Call the MB_MASTER instruction
Open the Main [OB1] block. Navigate to Instructions → Communication → Communication Processor → Modbus, and drag the MB_MASTER instruction into the program segment as shown below.

In this instruction, set MB_ADDR (slave address) to 1 and MODE to 0, which puts the master in read mode. The DATA_ADDR starting address is 424620. This address corresponds to parameter Pr8.43 (motor position) for RS485 communication. The Modbus register address for Pr8.43 is 0x602B, which is 24619 in decimal. Adding the T6 driver's holding register offset of 400001 gives: 24619 + 400001 = 424620.
- Step 7: Run the program and read Pr8.43
In the PLC program, the received data is 0x1A9D, which converts to decimal 6813. Verify on the T6 driver that Pr8.43 = 6813 to confirm the data was read correctly.
- Summary
This article demonstrates a basic Modbus RTU communication setup between the Siemens S7-1200 PLC and the T6 driver. The same approach can be adapted for communication between the S7-1200 and other StepperOnline drivers.