Alok Nath
Alok Nath

Reputation: 35

TwinCAT 3 HMI button as a counter

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?

Upvotes: 2

Views: 371

Answers (1)

Felix
Felix

Reputation: 1189

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.

Upvotes: 3

Related Questions