KB-34667: Clicking on screen buttons via external device.

Question:

How can I simulate clicking an application’s buttons (for example, four directional arrows and one OK button) via HMI?

Solution:

To do so, create a Matrix tag, linking each cell to a tag, and each tag to a button. To indicate to the application which button to be click on, create a Ram tag to work as a Pointer. Then, create a script in OnValueChanged event in the tags corresponding to the HMI’s arrows; this script must change the Pointer tag’s value when the arrow is pressed. In the tag corresponding to the HMI’s OK button, create a script in the OnValueChanged event, and use the Global Manager’s RunMacro method.

Example of script: RunMacro(Pointer + ” = 1″)

Thus, the cell tag defined in the Pointer tag receives the value 1. For example, if the Pointer tag’s value is “r1c3”, by executing the script row above, the r1c3 tag receives the value 1, if it exists. Now, just link the cell tags to the screen buttons. Remember to configure the buttons’ type as “Jog”.

NOTE: Attached to this article is a sample application that shows how this system works.

Attachments:

AppButtons eng

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *