How to access component property from gateway or client event

Hello everyone,

I am trying to access the visibility status of a label component from a gateway event or client event tag change. Do you know if this is possible? I tried different tag paths but none of them were successful.

I wrote this but it is not working.

tag = system.gui.getParentWindow(event).getComponentForPath('Root Container.Label') 
print(tag.visible)

You can’t access such from a gateway event. The code runs in different processes and/or different computers entirely.

From a client event, you can request a reference to the window containing the component, then drill down the hierarchy to that component.

I suspect what you really need is to re-arrange your environment so that a gateway tag implements the logic needed for the component’s visibility, and bind the component to that. Client visual logic should never drive the rest of your system. Client events, like push buttons and entry fields should be able to impact the logic, but state that is part of the operation needs to be held in the gateway, or better, in the PLC.

2 Likes