Some content on this site is available only to logged-in subscribers. Contact Us for information on becoming a subscriber.

InSource.Solutions | InSource Training | InSource Client Portal
InSource Solutions Logo
Log In Sign Up
InSource.Solutions InSource Training InSource Client Portal Log In Sign Up
  • Home
  • AVEVA OMI
  • AVEVA OMI Tech Notes

TN 1209 Exiting OMI Applications Programmatically

Last updated: February 20th, 2025

Description

  • Author: Mario Meza
  • Published: February 20th, 2025

Details:

Description

This article from InSource shows a couple script options for exiting OMI Applications. 

  • Author: Mario Meza
  • Published:12/22/2021
  • Applies to: OMI All Versions

Details

Create a Symbol in the Graphic tool box and name it whatever you like. In the example it's called ShutItDown.

Once the symbol is created , open the symbol editor by right clicking and selecting Open or simply double clicking on the symbol. 

In this example two buttons were created: 

  • The first button for closing a single instance of OMI.
  • The second for closing multiple instances of OMI.

Double click the Single Instance button and give it an Action Script Animation

Paste the script below in the script editor and select OK.

dim wProcess as System.Diagnostics.Process;
wProcess = System.Diagnostics.Process.GetCurrentProcess();
wProcess.CloseMainWindow();

Double click the Multi Instance button and give it an Action Script Animation.

Paste the script below in the script editor and select OK.

dim procArray[10] as System.Diagnostics.Process;
dim proc as System.Diagnostics.Process;
procArray = System.Diagnostics.Process.GetProcessesByName("view");
for each proc in procArray[];
proc.Kill();
next;

Save and Close the Symbol Editor.

Check in the object.

Open the OMI application and place the symbol in a layout. From here you can test the single instance button by placing the app in preview mode. 

To test the buttons, from the OMI application manager open a few instances of the application. In the example four instances were launched.

The single instance button will shut down the instance from where the button was pressed (bottom left). 

The Exit Multi Instance button should kill all remaining instances when pressed from any application instance.

If you happened to have more than 10 view instances you would just update the procArray[ ] to the desired number when it was first instantiated in the script.

 

exiting automated
Give feedback about this article

Recommended articles

How to receive group emails

Read More
Support Icon

CONTACT SUPPORT

How to reach us

10800 Midlothian Turnpike Tpke, Suite 209, Richmond, VA 23235

1.877.INSOURCE

Technical Support - 1.888.691.3858

Contact Us

  • InSource Solutions
  • InSource Training
  • InSource Client Portal
  • Log In
InSource Solutions Logo

© 2025 InSource Solutions. All Rights Reserved.

Knowledge Base Software powered by Helpjuice

Expand