当前位置: 主页 > PLC控制

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

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

最佳答案

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

ifmytagthen
mycounter=mycounter+1
endif
ifmycount>43200then//计数时间大于30天,60*24*30=43200
hmiruntime.tags("alarm").write1
else
hmiruntime.tags("alarm").write0
endif
ifhmiruntime.tags("rESet").readthen//按钮复位按钮给reset赋值1
hmiruntime.tags("motor_count").write0//计数清零
hmiruntime.tags("reset").write0//复位复位变量
endif

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

专家置评

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

  • 关注微信

猜你喜欢

微信公众号