一、制作说明:
1、绘制屏幕底图和图形库元件。
2、导入底图,添加控件,设置属性。
3、编写宏。
二、宏说明:
1、利用画面开启宏设定电梯轿厢初始位置。
2、点击楼层按钮,宏指令将轿厢平层数据复制到目的值寄存器,同时与轿厢Y轴数据比较:当Y轴值小于目的值时,Y轴数值按每扫描周期做加1运算,轿厢下移。大于时,上移。等于时,清除按钮。
3、轿厢移动时,Y轴数据与目的数据比较,等于时刷新楼层寄存器显示数值。
4、轿厢移动时自动关门。
三、画面开启宏
$11 = 247
$21 = 382
$22 = 309
$23 = 236
$24 = 163
$25 = 90
$26 = 17
END
四、Clock宏
IF $0.1 == ON
$13 = $21
ENDIF
IF $0.2 == ON
$13 = $22
ENDIF
IF $0.3 == ON
$13 = $23
ENDIF
IF $0.4 == ON
$13 = $24
ENDIF
IF $0.5 == ON
$13 = $25
ENDIF
IF $0.6 == ON
$13 = $26
ENDIF
IF $12 == $21
$1 = 1
ENDIF
IF $12 == $22
$1 = 2
ENDIF
IF $12 == $23
$1 = 3
ENDIF
IF $12 == $24
$1 = 4
ENDIF
IF $12 == $25
$1 = 5
ENDIF
IF $12 == $26
$1 = 6
ENDIF
IF $12 < $13
$12 = $12 + 1
$10 = 0
ELSEIF $12 > $13
$12 = $12 - 1
$10 = 0
ELSE
$0 = 0
$10 = 1
ENDIF
END
楼主最近还看过