Mouse Events (on Release)

Is there any Mouse Event for a Mouse Left click release, or how do you implement this on code.

I’m new to Python and Ignition im trying to program a button, when it’s clicked I it’s supposed to set a tag to a value of 1, when the left clicked is released I need to set the tag value to 0.

Thank for any help or advice.

The behavior you are describing is that of a momentary button. Is this for control?

See this for some of the plethora of reasons this isn't a great idea.

This button only resets a counter within the PLC program, so I want it to give a value of 1 to reset the counter and when the click is released the value returns to 0 and the counter stops resetting

and yes, the behavior that I describe is that of a momentary button

I would probably just set the tag with the button and have the PLC reset it once the counter was reset.

You can use the mouse events to write to the tag, if for some reason you can not make the change in the PLC.

{I'm being intentionally vague}

2 Likes

Yes, I am an intern and currently I do not have access to the PLC program and I cannot make that modification.

If you try to set back to zero on mouse release, and any comms problem occurs at that point, the bit will be stuck on. Effectively forever. And your counter stops working.

I don't know if your supervisor has set you a trick question, but momentary buttons on HMIs that aren't carefully designed to be reliable are a disaster waiting to happen. Perspective, being browser based, presents an especially difficult environment for this task, and IA wisely did not provide any implementation of this kind of button.

In Admiral Ackbar voice: It's a Trap!

4 Likes

Thanks for your help and support!!