Basic Elements Of A Program - Siemens Simatic S7-200 System Manual

Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Create the Configuration Drawings
Based on the requirements of the functional specification, create configuration drawings of the control
equipment. Include the following items:
-
Overview showing the location of each S7-200 in relation to the process or machine
-
Mechanical layout of the S7-200 and expansion I/O modules (including cabinets and other
equipment)
-
Electrical drawings for each S7-200 and expansion I/O module (including the device model
numbers, communications addresses, and I/O addresses)
Create a List of Symbolic Names (optional)
If you choose to use symbolic names for addressing, create a list of symbolic names for the absolute
addresses. Include not only the physical I/O signals, but also the other elements to be used in your
program.

Basic Elements of a Program

A program block is composed of executable code and comments. The executable code consists of a main
program and any subroutines or interrupt routines. The code is compiled and downloaded to the S7-200;
the program comments are not. You can use the organizational elements (main program, subroutines, and
interrupt routines) to structure your control program.
The following example shows a program that includes a subroutine and an interrupt routine. This sample
program uses a timed interrupt for reading the value of an analog input every 100 ms.
Example:Basic Elements of a Program
M
A
I
N
S
B
R
0
I
N
T
0
Programming Concepts, Conventions, and Features
Network 1
//On first scan, call subroutine 0.
LD
SM0.1
CALL
SBR_0
Network 1
//Set the interval to 100 ms
//for the timed interrupt.
//Enable interrupt 0.
LD
SM0.0
MOVB
100, SMB34
ATCH
INT_0, 10
ENI
Network 1
//Sample the Analog Input 4.
LD
SM0.0
MOVW
AIW4,VW100
Chapter 5
5
49

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents