恭喜,你发布的帖子
发布于 2023-04-12 15:30:20
1楼
根据一个变量 由1 变为 0 时 显示一个倒计时为 100 分钟,而变量由0变化到1时,触发一个倒计时为80分钟。参考一下吧
If HMIRuntime.Tags("tag1").read =1 Then
If HMIRuntime.Tags("counter80").read <=0 Then
HMIRuntime.Tags("counter80").Write 0
”执行倒计时80动作
Else If HMIRuntime.Tags("counter80").read >0 Then
HMIRuntime.Tags("counter80").Write HMIRuntime.Tags("counter80").read -1
End If
End If
HMIRuntime.Tags("counter100").Write 100
End If
If HMIRuntime.Tags("tag1").read =0 Then
If HMIRuntime.Tags("counter100").read <=0 Then
HMIRuntime.Tags("counter100").Write 0
”执行倒计时100动作
Else If HMIRuntime.Tags("counter100").read >0 Then
HMIRuntime.Tags("counter100").Write HMIRuntime.Tags("counter100").read -1
End If
End If
HMIRuntime.Tags("counter80").Write 80
End If
全局脚本,1分钟周期运行;或者1秒(把上述分钟换算成秒)
请填写推广理由:
分享
只看
楼主