Skip to main content
Version: 8.3 Beta 🚧

system.vision.openWindow

Backwards Compatibility

This function replaces system.nav.openWindow. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. Only the system.vision variations will appear in the Script Editor's autocomplete popup.

This function is used in Python Scripting.

Description​

Opens the window with the given path. If the window is already open, brings it to the front. The optional params dictionary contains key:value pairs which will be used to set the target window's root container's dynamic variables.

For instance, if the window that you are opening is named "TankDisplay" and has a dynamic variable in its root container named "TankNumber", then calling system.vision.openWindow("TankDisplay", {"TankNumber" : 4}) will open the "TankDisplay" window and set Root Container.TankNumber to four. This is useful for making parameterized windows, that is, windows that are re-used to display information about like pieces of equipment. See also: Parameterized Popup Windows.

note

This function is available on secondary desktops via the system.vision.desktop function. See the Multi-Monitor Clients page for more details on secondary desktops.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.vision.openWindow(path, [params])

Parameters​

TypeParameterDescription
StringpathThe path to the window to open.
Dictionary[String, Any]paramsA dictionary of parameters to pass into the window. The keys in the dictionary must match dynamic property names on the target window's root container. The values for each key will be used to set those properties. [optional]

Returns​

Window - A reference to window that was navigated to. Refer to the list of window objects.

Scope​

Vision Client

Code Examples​

Example #1
# This is the simplest form of openWindow.
system.vision.openWindow("SomeWindowName")
Example #2
# A more complex example - a setpoint screen for multiple valves that opens centered.
titleText = "Third Valve Setpoints"
tankNo = system.vision.openWindow("ValveSetPts", {"valveNum":3, "titleText":titleText})
system.vision.centerWindow("ValveSetPts")
Example #3
# Opens a popup window, and sets the dimensions to 100 pixels x 100 pixels.
window = system.vision.openWindow("popup")
window.size = (100,100)