Siemens Simatic S7-200 System Manual page 233

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

Advertisement

Example of Pulse Train Output
Network 1
SM0.1
Network 2
Network 3
SBR
Network 4
SM0.0
16#8D
Network 5
Figure 10-18
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
LAD
Q0.0
On the first scan, reset
R
image register bit low, and
1
call subroutine 0.
0
CALL
End of main ladder.
END
0
Start of subroutine 0.
Set up PTO 0 control byte:
MOV_B
- select PTO operation
EN
- select ms
increments
IN
OUT
SMB67
- set the pulse count and
cycle time values
- enable the PTO function
MOV_W
EN
Set cycle time to 500 ms.
500
IN
OUT
SMW68
MOV_DW
Set pulse count to
EN
4 pulses.
4
IN
OUT
SMD72
ATCH
Define interrupt routine 3
EN
to be the interrupt for
processing PTO 0
3
INT
interrupts.
19
EVENT
ENI
Global interrupt enable.
PLS
Invoke PTO 0 operation.
EN
PLS 0 => Q0.0
0
Q0.x
Terminate subroutine.
RET
Example of a Pulse Train Output
Instruction Set
STL
Network 1
LD
SM0.1
R
Q0.0, 1
CALL
0
Network 2
MEND
Network 3
SBR
0
Network 4
LD
SM0.0
MOVB
16#8D, SMB67
MOVW
500, SMW68
MOVD
4, SMD72
ATCH
3, 19
ENI
PLS
0
Network 5
RET
10-45

Advertisement

Table of Contents
loading

Table of Contents