Siemens SIMATIC S7 CP340 Programming Manual page 49

Table of Contents

Advertisement

5 MODBUS RTU Protocol communication
Fig. 87: Compile and save hardware configuration
5.2.3
Write communication program
1. Double-click OB1 to open OB1 programming screen. Invoke send program
block FB8 P_SND_RK from Libraries -> CP PtP -> CP341 and distribute instance
data block DB8 to it. Set the parameter LADDR as the input start logic address 256
in hardware configuration.
Fig. 88: Logic address of CP341
2. Create send data block DB1, in which the slave address is 2, the function code
is 3 and start address is 0. Read 4 register data. For use of the function code 3,
see Modbus Master Manual - 5.3: Function Code 03 - Read Output Registers.
Fig. 89: Send Data block DB1
3. Invoke Send Function block
The FB8 P_SND_RK parameter setting may be seen in the table below:
SF
LADDR
CP340/CP341/CP440/CP441 Communication and Programming
Entry-ID: 88867653,
V1.0,
"S" means send, which must be in capital form here.
Start logic address in hardware configuration, which is 256 in this
02/2014
49

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7 cp341Simatic s7 cp441Simatic s7 cp440

Table of Contents