4 ASCII protocol communication
CP340/CP341/CP440/CP441 Communication and Programming
Entry-ID: 88867653, V1.0, 02/2014
33
S
ie
m
e
n
s
A
G
2014
A
ll r
ig
h
ts
r
e
s
e
rv
e
d
Fig. 53: Invoke SFB12 BSEND from OB1
3. At the same time, invoke SFB13 BRCV to receive data, and distribute
instance data block DB13, and create a new DB block DB2 to receive data.
Fig. 54: Receive data block DB2
Name
Data type
comments
EN_R
BOOL
Receive enable bit, allowing receive when it is
1. M8.0 is used in this example.
ID
WORD
Local ID number, which is obtained from the
PtP connection properties and is hexadecimal.
R_ID
DWORD
W#16#0 must be used when in ASCII, 3964(R)
communication.
RD_1
ANY
Data receive area. DB2 is used in this example
to receive.
LEN
WORD
Receive data length memory area, in bytes
NDR
BOOL
Receive complete bit, which is TRUE if Receive
completes and has no error
ERROR
BOOL
error bit, 1 indicating that it has an error
STATUS
WORD
Status word, indicating error code. The specific
information may be seen in online diagnosis of
module or from CP441 Manual - Chapter 9:
Diagnosis information
Table 11: Parameter definition of SFB13 BRCV