Sample Program For Data Exchange If Code Length ≤ 27 Bytes - Siemens SIMATIC MV500 Operating Instructions Manual

Hide thumbs Also See for SIMATIC MV500:
Table of Contents

Advertisement

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
SIMATIC MV500
Operating Instructions, 03/2021, C79000-G8976-C494-05
Structure of the STL program
//Enter data ID (in principle only necessary in the first cycle)
L
B#16#81
T
AB 8
// Check number of data packet for 1
L
EB 5
L
1
<>
I
SPB
m001
// Import user data from the optical reader
L
ED 9
Process interfacing via an automation system (PLC, PC)
// Only result string
// No. of the data packet from the optical reader
// If no. ≠ 1
// ... user data is not available yet
// Read first 4 bytes of user data
9.4 Control with FB 79
181

Advertisement

Table of Contents
loading

Table of Contents