Skip to main content

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 SampleFilter.xriofilter file. Navigate to %PROGRAMFILES(x86)%\OMICRON\Test Universe\Apps\XRio\Filters for 32-bit or %PROGRAMFILES%\OMICRON\Test Universe\Apps\XRio\Filters for 64-bit then paste the MyImportFilter folder and the SampleFilter.xriofilter in the filters folder.


Now, download the OCC test document in this link (Omicron Control Center - Using Import Filter). This OCC test document was created in the previous tutorial (Omicron Control Center Custom Dialog - Change Data With Feedback).

Open the OCC test document then open the Test Object. From there we could access the import filter that we installed and run it. In the Test Object window, click the File>Import Relay Settings menu.


In the list, you will find the Sample Import Filter.


Select that filter then click OK button.


We have successfully execute the Import Filter via Test Object. Next I will show you how to execute the Import Filter using script.

Now open the Script window by clicking the Script View button at the View tab. Stop the script if running. Copy the code below and paste it to the very bottom of the script.

Const TEXT_IMPORT_SETTINGS As String = "Do you want to import the relay setting?"
Const USER_DIALOG_IMPORT_SETTINGD As String = "Import Relay Setting "

Public Sub ImportRelaySettings()
On Error GoTo ErrorHandler
Dim xrioapp As XRio
Dim i As Integer
Dim fil As Variant
Dim Automation As Integer
Dim IsImportFilterFound As Boolean

IsImportFilterFound=False

Automation=GenericMessageBox(TEXT_IMPORT_SETTINGS,USER_DIALOG_IMPORT_SETTINGD,1)

If Automation = vbYes Then
Set xrioapp = Document.TestObjects(1).Specific

For i = 1 To xrioapp.XRioFilters.Count
If xrioapp.XRioFilters(i).ID = "MyImportFilter.SampleFilter" Then
IsImportFilterFound=True
If xrioapp.XRioFilters(i).ShowParameterDialog(True) Then
If xrioapp.XRioFilters(i).ExecuteImport Then

End If
End If
Exit For
End If
Next
If Not IsImportFilterFound Then
MsgBox("No import filter installed on this computer for this test plan/routine.", vbOkOnly+ vbInformation,"Import Filter Not Installed")
End If
Set xrioapp = Nothing
Document.TestObjects(1).CommitChanges
End If
Exit Sub
ErrorHandler:
MsgBox ("Importing relay settings cannot be perform." & vbNewLine & "Maybe the import filter was not installed.", vbOkOnly+ vbCritical,"Error")
End Sub

Public Function GenericMessageBox(Text As String, Title As String, style As Integer) As Integer
'Parameters:
'Text: The text prompted to the user
'Title: Title of the Message Box
'Style: Choose between two styles, 1 = YesNo with Yes as default and question mark, 2 = OkCancel with Ok as default and information icon

Dim MsgBoxStyle As Integer

If style = 1 Then
MsgBoxStyle = vbYesNo Or vbDefaultButton1 Or vbQuestion
ElseIf style = 2 Then
MsgBoxStyle = vbOkCancel Or vbDefaultButton1 Or vbInformation
End If

GenericMessageBox = MsgBox(Text,MsgBoxStyle,Title)
End Function

Highlight the ImportRelaySetting procedure as shown in the image below then click the User Commands button under Tools group. Check on the Show as button, set the display name to Import Relay Settings and set the tooltip to Click here to import the relay settings. Then, click Add button and close the user commands dialog box.


Close the Script window by clicking the Back to Report View button and check the Home tab, the Import Relay Settings command should be added in the ribbon menu.


Now, click the Import Relay Settings button then click Yes button to continue.


We have successfully executed the Import Filter using the script. In the next tutorial, I will show you how to create a user interface (UI) for this Import Filter and I will show you how to access the Test Object parameters in the user interface (UI). See you next time.

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...

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...

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 ...