发布于 2012-06-28 10:47:04
1楼
每天早上Motor_Run自动为“1”机组运行,每天傍晚Motor自动为“1”,机组停止工作,你启停都是给变量赋值1?写错了吧?最好是启动为1,停止为0.
1、读取星期几WeekDay(Now)(网上找来的不知道是不是好用)返回值是周日~周六对应1~7.
2、vbs中读取系统时间(now())
3、if weekday(now)>=2 and weekday(now)<=6 then
if hour(now)>=6 and hour(now)<18 then
hmiruntime.tags("motor_run").write 1
else hmiruntime.tags("motor_run").write 0
end_if
else if hour(now)>=8 and hour(now)<18 then
hmiruntime.tags("motor_run").write 1
else hmiruntime.tags("motor_run").write 0
end_if
end_if
活到老,学到老!为了生活学习吧!