Skip to main content

Display Test Object Data In Omicron Control Center Custom Dialog

Welcome to the second part of the tutorial series about Omicron Control Center (OCC) Custom Dialog. In this tutorial, I will show you how to retrieve the data from the OCC document test object and display it to the custom dialog.


Now, open the OCC document that created in the first part of this series. If you don't have it, please check the first part of the series (Omicron Control Center Custom Dialog - Creating Custom Dialog). Follow the step by step procedure there to create the a OCC document then return to this page.

Before we start writing coding, we have to add Omicron libraries to reference of the existing OCC document. In the View tab and under the Document Views group, click the Script View button to open the scripts we've created in the previous tutorial. Stop the script by clicking the Stop Script button under the Run Script group to enable us to edit or modify the script. Click the References button then the reference dialog will open. In the reference list, find the OMXRio (4.20), OMXRioData (4.20), OMXRioDependency (4.20) & OMXRioFilter (4.20) and thick them then click OK button. In my computer the Omicron reference library installed is version 4.20, your computer might be different.

Once the libraries loaded, copy the codes below and paste them into the script window. The codes below will be use to get the data from the OCC Document test object and display in the custom dialog.

Function GetDisplayString(Parameter As AutoParameter) As String
If Not Parameter Is Nothing Then
GetDisplayString = Parameter.DisplayString
Else
GetDisplayString = "-"
End If
End Function

Then declare Public GlobalTO as Xrio and set an instance from the document's test object inside the SetRelayInformation procedure in the first line before the Begin Dialog.

Set GlobalTO = Document.TestObjects(1).Specific

Then copy the codes below and insert them to inside the SetRelayInformation procedure between the line Dim dlg As UserDialog and Dialog dlg.

dlg.txtSubstationName = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".SUBSTATION_NAME"))
dlg.txtSubstationAddress = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".SUBSTATION_ADDRESS"))
dlg.txtCBName = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".CB_NAME"))
dlg.txtCircuitName = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".CIRCUIT_NAME"))
dlg.txtDeviceType = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".DEVICE_TYPE"))
dlg.txtManufacturer = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".MANUFACTURER"))
dlg.txtSerialNumber = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".SERIAL_NUMBER"))
dlg.txtDeviceAddress = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".DEVICE_ADDRESS"))

Once completed the overall code should be looks like the codes below.

' ************************************************************
' This is module *Module1 .
' Automatically generated uses comments are placed here.
' Don't edit these lines.
' {BEGINUSES}
'#Uses "*Module1"
' {ENDUSES}
' ************************************************************


Public Const BASIC_INFO_PATH As String = "CUSTOM.RELAY_INFORMATION.BASIC"
Public GlobalTO As XRio

Sub SetRelayInformation
On Error GoTo ErrorHandler
Set GlobalTO = Document.TestObjects(1).Specific

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

dlg.txtSubstationName = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".SUBSTATION_NAME"))
dlg.txtSubstationAddress = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".SUBSTATION_ADDRESS"))
dlg.txtCBName = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".CB_NAME"))
dlg.txtCircuitName = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".CIRCUIT_NAME"))
dlg.txtDeviceType = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".DEVICE_TYPE"))
dlg.txtManufacturer = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".MANUFACTURER"))
dlg.txtSerialNumber = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".SERIAL_NUMBER"))
dlg.txtDeviceAddress = GetDisplayString (GlobalTO.XRioDocument.GetParamFromIDs(BASIC_INFO_PATH & ".DEVICE_ADDRESS"))

Dialog dlg

Set GlobalTO = Nothing

Exit Sub
ErrorHandler:
MsgBox(Err.Description, vbOkOnly+ vbCritical,"Error")
End Sub

Function GetDisplayString(Parameter As AutoParameter) As String
If Not Parameter Is Nothing Then
GetDisplayString = Parameter.DisplayString
Else
GetDisplayString = "-"
End If
End Function


Now, close the script window by clicking the Back To Report View button then run the script by click the Set Relay Information button in the Home tab under the User Commands group and the result should be like the in the image below.


Now, we have successfully display the test object data into custom dialog that we've created. I will show you in the next tutorial on how to save the data back to test object once the 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...

Install And Use Newly Created Import Filter In Omicron Test Universe

Welcome to my page. This is the second part of the Omicron Import Filter tutorial series. In this tutorial, I will show you how install  and use the Import Filter that we've created in the previous tutorial in this series using two methods.  The first one via Test Object and the second one is via script. Open the Visual Studio project called MyImportFilter that we created in the first part of tutorial which can be found here ( Omicron Import Filter - Create New Filter ). Once the project opened, right click on the project at the solution explorer the click Open Folder in File Explorer. The project file directory will open. Open the  bin\Debug folder and you will find the two files in that folder ( MyImportFilter.dll and  SampleFilter.xriofilter ). Create new folder in that directory and set the folder name to  MyImportFilter . Move the  MyImportFilter.dll file to the  MyImportFilter folder then, copy the  MyImportFilter folder and the  Sa...

Change Data With Feedback In Omicron Control Center Custom Dialog

Welcome to the fifth and final part of the tutorial series about Omicron Control Center (OCC) Custom Dialog. In this tutorial, I will show you how to get a real-time feedback when data was change. This will be helpful that you will be notified what will be the outcome of the changed data. Check the video below. Now, open the OCC document that we used in the previous tutorial. If you don't have it check this link ( Omicron Control Center Custom Dialog - Creating Custom Dialog With Dropdown Control ) then come back here once you have OCC document. When the document is loaded, open the script view by clicking the Script View button under the View tab then stop the script if its running. Now, find the  SetTheSourceController sub procedure. We're going to modify this codes and use different methods of loading data from the test object and saving back to test object. Point the mouse pointer and click between  Begin Dialog and  End Dialog then click the Edit Dialog button un...