检查时间是否更新的Javascript代码
我想知道是否有人可以帮助我编写一段 JavaScript 代码来检查我的 HMI 上的时间是否每秒更新一次,如果时间停止,它应该提醒用户。 我有一个名为“device.string.TIME”的字符串变量,我的 HMI 正在通过 modbus 从 PLC 读取该变量,HMI 读取的格式为字符串“12:00:00”。该字符串从 PLC 连续更新(1 秒),现在当该时间过时 2 秒时,我想提醒用户。
I was wondering if anybody can help me to write a javascript code that will check whether the time on my HMI is updating every seconds, if the time stops it should alert the user.
I have a string variable called "device.string.TIME" that my HMI is reading from the PLC over modbus, the format the HMI is reading is in strings "12:00:00". This string is updating continuously (1 second) from the PLC, now when this time gets stale for 2 seconds i want to alert the user.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1000 毫秒 = 一秒
1000ms = one second