4 ASCII protocol communication
CP340/CP341/CP440/CP441 Communication and Programming
Entry-ID: 88867653, V1.0, 02/2014
11
S
ie
m
e
n
s
A
G
2014
A
ll r
ig
h
ts
r
e
s
e
rv
e
d
Fig. 9: Wiring of receiver at interface RS485/422
8. After the parameters are configured, click
button to save and compile the
hardware configurations. After it is confirmed that no error exists, download the
hardware configurations to CPU to complete the whole hardware configuration
process.
Fig. 10: Compile and save hardware configuration
4.1.3
Write communication program
1. Double-click OB1 to open OB1 programming screen. Invoke Send Function
Block FB3 P_SEND from Libraries -> CP PtP -> CP340 and distribute instance
data block DB3 to it. Set the block parameter LADDR as the start logic address 256
for module CP340 in hardware configuration.
Fig. 11: Logic address of CP340
2. Create Send Data block DB1.
R(A)0V/R(B)5V
R(A)5V/R(B)0V