只利用WINCC做一个时间报警程序

因不是很熟悉WINCC的脚本功能,想只利用WINCC做一个电机时间运行时间的监控,只要到了30天就输出一个报警,按下复位按钮后会重启开始计时;各位高手们有什么办法,在下对WINCC的使用比较少,希望能多给些资料和代码,有实例最好。

最佳答案

直接用wincc做,wincc全局脚本vbs(周期一分钟)
dim mytag,mycounter
mytag=hmiruntime.("motor_run").read//运行状态
mycounter=hmiruntime.("motor_count").read//运行计数

if mytag then
 mycounter=mycounter+1
end if
if mycount>43200 then//计数时间大于30天,60*24*30=43200
 hmiruntime.tags("alarm").write 1
else 
 hmiruntime.tags("alarm").write 0
end if
if hmiruntime.tags("reset").read then//按钮复位按钮给reset赋值1
 hmiruntime.tags("motor_count").write 0//计数清零
hmiruntime.tags("reset").write 0//复位复位变量
end if

提问者对于答案的评价:
非常感谢!

专家置评

已阅,最佳答案正确。建议用户首先学习基本理论知识以及VBS编程语言。

原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc186496.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2017年7月25日 下午10:30
下一篇 2017年7月25日

相关推荐