How to Close a Perspective Popup Asynchronously After a Delay in Ignition?

  • In Project Browser, select the root of your view.
  • In Perspective Property Editor scroll down to CUSTOM.
  • Create a new custom property startTime.
    • Create an expression binding on startTime with the expression, now(0). This will fire once when the popup opens and save the current timestamp in the custom property.
  • Create a second tag, timeout.
    • Add an expression binding,
      (now(1000) - {this.custom.startTime}) > 5000
      This will evaluate every 1000 ms and will return true when the popup has been open for 5000 ms.
  • Right-click on custom.timeout and select Edit Change Script. Add the script,
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue.value:
		system.perspective.closePopup("")

Tips:
now(0) → Runs once on load.
now() → Runs at the default scan rate - typically 1000 ms.
now(4321) → Runs every 4321 ms.

1 Like