EasyManua.ls Logo

Siemens Simatic S7 Series

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming concepts
5.2 Elements of the user program
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
89
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.
Table 5- 1 Sample program with a subroutine and an interrupt routine
Main
Network 1
LD SM0.1
CALL SBR_0
On first scan, call subrou-
tine 0.
SBR 0
Network 1
LD SM0.0
MOVB 100, SMB34
ATCH INT_0, 10
ENI
Set the interval to 100 ms
for the timed interrupt.
Enable interrupt 0.
INT 0
Network 1
LD SM0.0
MOVW AIW4,VW100
Sample the value of analog
input AI4.

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals