Skip to main content

Omicron Control Center Custom Dialog - Creating Custom Dialog

This is the series of tutorial for Omicron Control Center (OCC) Custom Dialog. This is the first part of the series. In this tutorial, I will show you on how to make a custom dialog inside the Omicron Control Center (OCC) document using VB script. OCC document is also known as omicron test document, test plan and test routine.


Scripting is the way of document automation. 
The automation of OCC document is very useful to manipulate the OCC document test modules or test object parameters without opening the test object window.

Making of custom dialog is very useful because we can change the target parameters in the test object without opining it. In few lines of codes, we can could get the test object parameter value like substation name or address, relay type, serial number & etc. and display it into a textboxes then change the textbox values and sent it back to the test object.

Create a new test document. 

Download this file "Omicron Control Center Automation - Custom Dialog.xrio" then import this in the test object and click OK so that, you don't have to create the xrio parameters and to make sure you can follow this tutorial.

In the OCC main window, navigate to View tab then click Script View under the document views section to view the script window. There are two view mode in this button, Full View or Side by Side view, just choose which one is your preferred. 

In the script window, stop the script by clicking the Stop Script button at the Script tab under the run script section to allow us to write new codes.

By default, Module1 is already created. We can add additional module by clicking the New Sheet button at Script tab under Script Sheet section. For now, we're going to write the codes in Module1.

Declare constant string BASIC_INFO_PATH and set the value to "CUSTOM.RELAY_INFORMATION.BASIC". This value come from the block ID in the test object from CUSTOM block node to Basic node and joined them with dot (.). This is called path ID.

 1
2
3
4
5
6
7
8
9
10
' ************************************************************
' This is module *Module1 .
' Automatically generated uses comments are placed here.
' Don't edit these lines.
' {BEGINUSES}
'#Uses "*Module1"
' {ENDUSES}
' ************************************************************

Const BASIC_INFO_PATH As String = "CUSTOM.RELAY_INFORMATION.BASIC"

Add new sub procedure SetRelayInformation.

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
' ************************************************************
' This is module *Module1 .
' Automatically generated uses comments are placed here.
' Don't edit these lines.
' {BEGINUSES}
'#Uses "*Module1"
' {ENDUSES}
' ************************************************************

Const BASIC_INFO_PATH As String = "CUSTOM.RELAY_INFORMATION.BASIC"

Sub SetRelayInformation

End Sub

Put the cursor inside the method then click the Edit Dialog button at the Script tab under the Tools section to create new custom dialog. User dialog editor will open after that.



Add eight textbox, eight label and one OK button then arrange them according to your taste and click save and exit button. This button is located second to the last button with tooltip save and exit. This will generate codes inside the sub procedure like the codes below. To edit it again in the user dialog editor, just put the cursor inside between the Begin Dialog and End Dialog then click the Edit Dialog in the ribbon menu.

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
' ************************************************************
' This is module *Module1 .
' Automatically generated uses comments are placed here.
' Don't edit these lines.
' {BEGINUSES}
'#Uses "*Module1"
' {ENDUSES}
' ************************************************************

Const BASIC_INFO_PATH As String = "CUSTOM.RELAY_INFORMATION.BASIC"

Sub SetRelayInformation
Begin Dialog UserDialog 480,273,"Relay Information Dialog Editor" ' %GRID:10,7,1,1
Text 10,14,140,14,"Substation Name:",.lblSubstationName
Text 10,42,140,14,"Substation Address:",.lblSubstationAddress
Text 10,70,140,14,"CB Name:",.lblCBName
Text 10,98,140,14,"Circuit Name:",.lblCircuitName
Text 10,126,140,14,"Device Type:",.lblDeviceType
Text 10,154,140,14,"Manufacturer:",.lblManufacturer
Text 10,182,140,14,"Serial Number:",.lblSerialNumber
Text 10,210,90,14,"Device Address:",.lblDeviceAddress
TextBox 160,14,300,21,.txtSubstationName
TextBox 160,42,300,21,.txtSubstationAddress
TextBox 160,70,300,21,.txtCBName
TextBox 160,98,300,21,.txtCircuitName
TextBox 160,126,300,21,.txtDeviceType
TextBox 160,154,300,21,.txtManufacturer
TextBox 160,182,300,21,.txtSerialNumber
TextBox 160,210,300,21,.txtDeviceAddress
OKButton 370,238,90,21,.btnOK
End Dialog
Dim dlg As UserDialog
Dialog dlg

End Sub

Now, click the User Commands button at the Script tab under the Tools section to create a command to use the procedure that we've created. By doing this, this will create a button/menu in the ribbon menu to execute the SetRelayInformation procedure.

Once the User Commands has been clicked, the user command window will open. In the subroutine textbox, type in the SetRelayInformation and make sure its the same character case in the procedure we've created. Check the show as button. In the display name textbox put anything, for me, I will put Set Relay Information the same with the procedure but I put space between the words. In the status bar/tooltip, put "Click here to open the relay information dialog editor". Click add button to add that in the list below the subroutine textbox. Then click close button to exit.

Click the Back to Report View to close the script window.
In the Home tab, you will realized that there's a new button created under the User Commands name Set Relay Information. Click that button, the newly created custom dialog will open.


Now, we have successfully created a new custom dialog but it does nothing. I will show you in the next tutorial on how to get data from the test object parameters and display them in the custom dialog we've created and save them back once OK button was clicked.



Comments

Popular posts from this blog

Micom SE Studio1 Import Filter - Creating User Interface (UI)

Welcome to my page and welcome to the continuation of Omicron Import Filter tutorial series. In this tutorial, I will show you how to create the actual import filter fom Micom relays. In this tutorial, we will focus on the Visual Studio program. We're going to modify the codes in our project called MyImportFilter that we've created in the previous tutorial.  Download the project in this link  MyImportFilter - Process Relay Setting Parameters . Extract and open the project. Once the project is loaded, add New Folder inside the project and set the name to SEStudio1. We need this to make organize our project class filter.  SE Studio 1 stands for Schneider Electric Studio 1 which is the software that used in communicating MiCOM relays particularly P12x series. And yes we're going to create a new import filter and user interface form MiCOM P12x series relay. I think this will applied to other MiCOM P series relay. Add a new Form inside the  SEStudio1 folder  and set the name to

Processing The Relay Setting Parameters In Omicron Import Filter

Welcome to my page and welcome to the fifth part of Omicron Import Filter tutorial series. In this tutorial, I will show you how to process the relay setting parameters that to be import in the Xrio converter. In this tutorial, we will focus on the Visual Studio program. We're going to modify the codes in our project called MyImportFilter that we've created in the previous tutorial.  Download the project in this link  MyImportFilter - Process Relay Setting Parameters . Extract and open the project. Once the project is loaded, add New Folder inside the project and set the name to SEStudio1. We need this to make organize our project class filter.  SE Studio 1 stands for Schneider Electric Studio 1 which is the software that used in communicating MiCOM relays particularly P12x series. And yes we're going to create a new import filter and user interface form MiCOM P12x series relay. I think this will applied to other MiCOM P series relay. Add a new Form inside the  SEStudio1 fo

Write An Encrypted Text File In Visual Basic

There are many ways to encrypt text or data. In this tutorial, DESCryptoServiceProvider class to encrypt and decrypt strings using the cryptographic service provider version of the Triple Data Encryption Standard algorithm. The use encryption to protect secret data and to make data unreadable by unauthorized users. Creating encryption wrapper Open the previous project from this tutorial  Write Text To File In Visual Basic  then rename it to WriteTextToFileWithEncryptionVB or create a new project. I recommend to open the existing project to easily follow this tutorial. Create the Encryption3DesWrapper class to implement the encryption and decryption methods. 1 2 3 Public NotInheritable Class Encryption3DesWrapper End Class Add an import of the cryptography namespace to the start of the file that contains the Encryption3DesWrapper class. 1 2 3 4 5 Imports System.Security.Cryptography Public Class Encryption3DesWrapper End Class In the Encryption3DesWr