TwinCAT 3 HMI按钮作为计数器

huangapple go评论92阅读模式
英文:

TwinCAT 3 HMI button as a counter

问题

我想在TwinCAT 3 HMI中使用按钮作为计数器。例如,工作流程如下。我有10个函数,我必须通过按下一个按钮来逐个触发这些函数以在TwinCAT 3中触发它们。我该如何做到这一点?

英文:

I want to use a button as a counter in TwinCAT 3 HMI. For example, the work flow is like this way. I have 10 functions and I have to trigger one by one by pressing a single button to trigger the functions in TwinCAT 3.
How can I do this?

答案1

得分: 3

首先,您需要将按钮链接到一个函数(例如,将其链接到按钮的'OnMouseClick'事件)。

链接的函数充当主函数,根据内部计数器值调用正确的函数。
因此,基本上,您需要以这样的方式设计主函数,使其

  1. 每次调用时增加一个计数器,并且
  2. 根据实际计数器值调用正确的函数。
英文:

First, you need to link the button to a function (e.g. by linking it to the 'OnMouseClick' event of the button).

The linked function acts as a master function which calls the correct function depending on an internal counter value.
So basically, you design that master function in a way, that it

  1. increments a counter every time it is called and
  2. calls the correct function depending on the actual counter value.

huangapple
  • 本文由 发表于 2023年5月24日 18:12:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76322396.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定