4-6
SIMATIC TD 200 Operator Interface
C79000-G7076-C272-01
NETWORK 1
LD
SM0.0
// on every scan...
MOVB
16#80,
VB12
// enable the message
FILL
16#2020, VW20,
10
// fill entire message with blanks
MOVD +0,
AC0
// clear a space to work
MOVD +0,
AC1
// ...
MOVB
SMB28,
AC0
// get the pot value
DIV
+13,
AC0
// divide pot value by 13 (20*13>256)
MOVB
16#FF,
VB19
// create the full bar character
BMB
VB19,
VB20,
AC0
// move full bars to message
MOVD AC0,
AC1
// put remainder into accumulator 1
SRD
AC1,
16
// move remainder to lower word
DIV
+3,
AC1
// divide remainder by 3 to get fifths
+I
16#FA,
AC1
// create character (number of fifths)
MOVD &VB20,
AC2
// point to start of message
+I
AC0,
AC2
// offset to first blank space
MOVB
AC1,
*AC2
// store partial block to buffer
Network 1
Ladder Logic
Statement List
SM0.0
IN
16#2020
FILL_N
EN
N
10
OUT
VW20
IN
+0
MOV_DW
EN
OUT
AC0
IN1
AC0
DIV
EN
IN2
+13
OUT
AC0
IN
VB19
BLKMOV_B
EN
N
AC0
OUT
VB20
IN
AC0
SHR_DW
EN
N
16
OUT
AC1
IN1
AC1
DIV
EN
IN2
+3
OUT
AC1
IN
16#80
MOV_B
EN
OUT
VB12
IN
+0
MOV_DW
EN
OUT
AC1
IN
SMB28
MOV_B
EN
OUT
AC0
IN
16#FF
MOV_B
EN
OUT
VB19
IN1
16#FA
ADD_I
EN
IN2
AC2
OUT
AC2
IN
&VB20
MOV_DW
EN
OUT
AC2
IN1
AC0
ADD_I
EN
IN2
AC2
OUT
AC2
IN
AC1
MOV_B
EN
OUT
*AC2
Figure 4-5
Sample Program for Creating a Bar Graph
Creating Sample Programs
Содержание SIMATIC TD 200
Страница 22: ...1 12 SIMATIC TD 200 Operator Interface C79000 G7076 C272 01 Product Overview and Installation ...
Страница 84: ...A 12 SIMATIC TD 200 Operator Interface C79000 G7076 C272 01 Specifications and Reference ...
Страница 94: ...B 10 SIMATIC TD 200 Operator Interface C79000 G7076 C272 01 Multiple CPU Configurations ...
Страница 126: ...E 6 SIMATIC TD 200 Operator Interface C79000 G7076 C272 01 Modifying a TD 200 Configuration ...