Example Of How To Set Up A Timed Interrupt To Read The Value Of An Analog Input - Siemens SIMATIC S7-200 System Manual

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

Advertisement

Figure 9-66 shows how to set up a timed interrupt to read the value of an analog
input.
MAIN PROGRAM
Network 1
SM0.1
SUBROUTINE 0
Network 1
SM0.0
INTERRUPT 0
Network 1
SM0.0
MAIN PROGRAM
Network 1
SM0.1
SUBROUTINE 0
Network 1
SM0.0
100
INTERRUPT 0
Network 1
SM0.0
Figure 9-66
S7-200 Programmable Controller System Manual
A5E00066097-02
LAD
SBR0
EN
MOV_B
EN
ENO
100
IN
OUT
SMB34
ATCH
EN
ENO
0
INT
10
EVNT
ENI
MOV_W
EN
ENO
AIW4
IN
OUT
VW100
SBR0*
EN
*Refer to page 9-149
MOV_B
EN
ENO
IN
OUT
SMB34
MOV_W
EN ENO
AIW4
IN
OUT
VW100
Example of How to Set Up a Timed Interrupt to Read the Value of an Analog
Input
First scan memory bit:
Call Subroutine 0.
Begin Subroutine 0.
Always on memory bit:
Set timed interrupt 0
interval to 100 ms.
Global Interrupt Enable
Attach timed interrupt 0 to
Interrupt routine 0.
Begin Interrupt routine 0.
Sample AIW4.
Terminate Interrupt routine.
FBD
ATCH
ENI
EN
ENO
0
INT
10
EVNT
SIMATIC Instructions
STL
Network 1
LD
SM0.1
CALL
0
Network 1
LD
SM0.0
MOVB
100, SMB34
ATCH
0, 10
ENI
Network 1
LD
SM0.0
MOVW
AIW4, VW100
9-179

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents