
Process interfacing via an automation system (PLC, PC)
9.4 Control with FB 79
SIMATIC MV500
Operating Instructions, 03/2021, C79000-G8976-C494-05
181
9.4.3
Sample program for data exchange if code length ≤ 27 bytes
Below, you will find a sample program for data exchange when the code length is a
maximum of 27 bytes.
Note
Compatible S7 controllers
The example program can only run on the following S7 controllers:
•
On a CPU 318 and all S7-400 CPUs.
•
On all S7-300 CPUs with MMC
On all other S7-300 and S7-400 CPUs, you must use SFCs 14 and 15 for all access to the two
user data interfaces.
Explanation of the program
The example program has the following properties:
•
Only the pure result string with data ID "B#16#81" is output.
•
The I/O controller does not check how many bytes the optical reader has returned but
always reads 27 bytes.
The I/O controller does not monitor anything.
•
The start of the "Send" user data interface is at address 4 of the process image input.
The start of the "Receive" user data interface is at address 4 of the process image output.
•
To ensure the consistency over the entire area of 32 bytes, there must be no update of the
process image during the program shown here.
•
The user data is stored in data block DB17 starting at byte 4.
STL program
Table 9- 42 Structure of the STL program
//Enter data ID (in principle only necessary in the first cycle)
L
B#16#81
// Only result string
T
AB 8
// Check number of data packet for 1
L
EB 5
// No. of the data packet from the optical reader
L
1
<>
I
// If no. ≠ 1
SPB
m001
// ... user data is not available yet
// Import user data from the optical reader
L
ED 9
// Read first 4 bytes of user data
Summary of Contents for SIMATIC MV500
Page 10: ...Preface SIMATIC MV500 10 Operating Instructions 03 2021 C79000 G8976 C494 05 ...
Page 16: ......
Page 28: ......
Page 32: ......
Page 92: ......
Page 114: ......
Page 148: ......
Page 244: ......
Page 254: ......
Page 260: ......
Page 292: ......
Page 294: ...Service Support SIMATIC MV500 294 Operating Instructions 03 2021 C79000 G8976 C494 05 ...