Anda di halaman 1dari 102

XRIO

Automation Interface
OMICRON Test Universe

Manual Version: XRIO_Automation.ENU.2 - Year: 2012


OMICRON electronics. All rights reserved.
This manual is a publication of OMICRON electronics GmbH.
All rights including translation reserved. Reproduction of any kind, e.g., photocopying, microfilming, optical
character recognition and/or storage in electronic data processing systems, requires the explicit consent of
OMICRON electronics.
Reprinting, wholly or in part, is not permitted. The product information, specifications, and technical data
embodied in this manual represent the technical status at the time of writing and are subject to change without
prior notice.
We have done our best to ensure that the information given in this manual is useful, accurate, up-to-date and
reliable. However, OMICRON electronics does not assume responsibility for any inaccuracies which may be
present.
The user is responsible for every application that makes use of an OMICRON product.

2
XRIO Automation

Table of Contents

1 Introduction ......................................................................................................................... 11
2 XRio Object Diagram ......................................................................................................... 12
3 General Hints ....................................................................................................................... 13
3.1 Lifetime of Object References 13
3.2 RIO Part Restrictions 14
3.3 Commit Changes 14
3.4 Global and Local Test Object 15
3.5 Prepare Automation Clients 17
Omicron Control Center ............................................................................................................................................. 17
Microsoft Excel VBA ................................................................................................................................................. 20
C# (Visual Studio 2003).............................................................................................................................................. 23
Example: ..................................................................................................................................................................... 24

4 Object Reference ................................................................................................................. 26


4.1 Application 26
4.1.1 XRio ..................................................................................................................................................... 26
Properties: ................................................................................................................................................................... 26
XRioDocument { get } ........................................................................................................................................... 26
XRioFilters { get } .................................................................................................................................................. 26
XRioDependency { get } ........................................................................................................................................ 26
Methods: ..................................................................................................................................................................... 26
TestObjectDialog .................................................................................................................................................... 26
BrowseLinkDialog.................................................................................................................................................. 27
BrowseLinkBoolDialog .......................................................................................................................................... 27
4.2 Document 28
4.2.1 AutoDocument ..................................................................................................................................... 28
Properties: ................................................................................................................................................................... 29
Version { get } ........................................................................................................................................................ 29
Root { get }............................................................................................................................................................. 29
CustomBlock { get }............................................................................................................................................... 29
RioBlock { get } ..................................................................................................................................................... 29
CommonData { get } .............................................................................................................................................. 29
Errors { get } .......................................................................................................................................................... 29
PredefinedReferences { get } .................................................................................................................................. 29
RioSupport { get } .................................................................................................................................................. 30
Methods: ..................................................................................................................................................................... 30
CreateNew .............................................................................................................................................................. 30
LoadFromFile ......................................................................................................................................................... 30

3
OMICRON Test Universe
LoadFromString...................................................................................................................................................... 31
LoadTextRioFromFile ............................................................................................................................................ 31
LoadTextRioFromString......................................................................................................................................... 31
SaveToFile .............................................................................................................................................................. 31
SaveToString .......................................................................................................................................................... 31
SaveTextRioToFile ................................................................................................................................................. 31
SaveTextRioToString ............................................................................................................................................. 31
GetGlobalScript ...................................................................................................................................................... 32
SetGlobalScript ....................................................................................................................................................... 32
GetBlockFromIDs .................................................................................................................................................. 32
GetParamFromIDs .................................................................................................................................................. 32
GetEnumValueFromIDs ......................................................................................................................................... 33
GetIDsPathFromBlock ........................................................................................................................................... 33
GetIDsPathFromParam ........................................................................................................................................... 33
GetIDsPathFromEnumValue .................................................................................................................................. 33
GetUserPathFromBlock .......................................................................................................................................... 33
GetUserPathFromParam ......................................................................................................................................... 33
GetUserPathFromEnumValue ................................................................................................................................ 33
HasRioFunction ...................................................................................................................................................... 34
ClearAllActiveRioFunctions .................................................................................................................................. 34
GetActiveRioFunction ............................................................................................................................................ 34
SetActiveRioFunction............................................................................................................................................. 35
4.2.2 AutoRioSupport ................................................................................................................................... 35
Methods ...................................................................................................................................................................... 35
AddRioFunction ..................................................................................................................................................... 35
4.2.3 AutoCommonData ............................................................................................................................... 35
Properties .................................................................................................................................................................... 35
AccessControl { get } ............................................................................................................................................. 35
IsInputFormatInfoUser { get, set } ......................................................................................................................... 35
IsOutputFormatInfoUser { get, set } ....................................................................................................................... 35
4.3 Document Nodes - Blocks and Parameters 36
4.3.1 AutoBlock and AutoParameter ............................................................................................................ 37
Properties .................................................................................................................................................................... 37
Id {get, set}............................................................................................................................................................. 37
Name {get, set} ...................................................................................................................................................... 37
Description { get, set }............................................................................................................................................ 37
Type {get} .............................................................................................................................................................. 37
ParentElementNode {get} ...................................................................................................................................... 37
Enabled { get, set } ................................................................................................................................................. 38
EnabledFormula { get, set }.................................................................................................................................... 38
HasEnabledFormula { get } .................................................................................................................................... 38
EnabledReferences { get;} ...................................................................................................................................... 38
CustomDataValues { get }...................................................................................................................................... 38
ForeignId { get, set } .............................................................................................................................................. 39
Iec61850 { get }...................................................................................................................................................... 39
UserComment { get, set } ....................................................................................................................................... 39

4
XRIO Automation
Methods ...................................................................................................................................................................... 39
IsParentOf ............................................................................................................................................................... 39
IsValidId ................................................................................................................................................................. 40
IsValidName ........................................................................................................................................................... 40
4.3.2 AutoBlock ............................................................................................................................................ 41
Properties .................................................................................................................................................................... 41
Blocks { get } ......................................................................................................................................................... 41
Parameters { get } ................................................................................................................................................... 41
IsRioFunction { get } .............................................................................................................................................. 41
ExternalEditorExist { get } ..................................................................................................................................... 43
SuppressPrintOut { get, set } .................................................................................................................................. 43
AutoParameter ........................................................................................................................................................ 44
Properties .................................................................................................................................................................... 44
DataType { get } ..................................................................................................................................................... 44
DisplayString { get } .............................................................................................................................................. 44
DisplayReferenceString { get } .............................................................................................................................. 44
ValueFormula { get, set } ....................................................................................................................................... 44
HasReferenceValue { get, set } .............................................................................................................................. 44
HasValueFormula { get } ....................................................................................................................................... 44
ValueReferences { get } ......................................................................................................................................... 44
ParameterBoolean { get } ....................................................................................................................................... 45
ParameterDouble { get } ......................................................................................................................................... 46
ParameterEnum { get } ........................................................................................................................................... 46
ParameterInteger { get } ......................................................................................................................................... 46
ParameterString { get } ........................................................................................................................................... 47
Methods ...................................................................................................................................................................... 48
SetDisplayValue ..................................................................................................................................................... 48
SetDisplayReferenceValue ..................................................................................................................................... 48
4.3.3 AutoParameterDouble .......................................................................................................................... 51
Properties .................................................................................................................................................................... 51
InternalValue { get, set } ........................................................................................................................................ 51
InternalReferenceValue { get, set } ........................................................................................................................ 51
InternalMin { get, set } ........................................................................................................................................... 51
InternalMax { get, set } .......................................................................................................................................... 51
MultiplierSymbol { get, set } .................................................................................................................................. 51
Unit { get, set } ....................................................................................................................................................... 51
DecimalPlaces { get, set } ...................................................................................................................................... 52
Parameter { get } .................................................................................................................................................... 52
Methods ...................................................................................................................................................................... 53
IsValidInternalValue............................................................................................................................................... 53
IsValidInternalMinValue ........................................................................................................................................ 53
IsValidInternalMaxValue ....................................................................................................................................... 53
IsValidMultiplierSymbol ........................................................................................................................................ 53
4.3.4 AutoParameterInteger .......................................................................................................................... 54
Properties .................................................................................................................................................................... 54
ParameterValue { get, set } .................................................................................................................................... 54

5
OMICRON Test Universe
ParameterReferenceValue { get, set } .................................................................................................................... 54
MinValue { get, set } .............................................................................................................................................. 54
MaxValue { get, set } ............................................................................................................................................. 54
Unit { get, set } ....................................................................................................................................................... 54
Parameter { get } .................................................................................................................................................... 54
Methods ...................................................................................................................................................................... 54
IsValidValue ........................................................................................................................................................... 54
IsValidMinValue .................................................................................................................................................... 55
IsValidMaxValue.................................................................................................................................................... 56
4.3.5 AutoParameterBoolean ........................................................................................................................ 57
Properties .................................................................................................................................................................... 57
ParameterValue { get, set } .................................................................................................................................... 57
ParameterReferenceValue { get, set } .................................................................................................................... 57
Parameter { get } .................................................................................................................................................... 57
4.3.6 AutoParameterString ............................................................................................................................ 57
Properties .................................................................................................................................................................... 57
ParameterValue { get, set } .................................................................................................................................... 57
ParameterReferenceValue { get, set } .................................................................................................................... 57
Parameter { get } .................................................................................................................................................... 57
4.3.7 AutoParameterEnum ............................................................................................................................ 58
Properties .................................................................................................................................................................... 58
ParameterValue { get, set } .................................................................................................................................... 58
ParameterReferenceValue { get, set } .................................................................................................................... 58
EnumValues { get } ................................................................................................................................................ 58
Parameter { get } .................................................................................................................................................... 58
4.4 Other Objects 59
4.4.1 AutoEnumValue ................................................................................................................................... 59
Properties .................................................................................................................................................................... 59
ParentElementNode { get }..................................................................................................................................... 59
Id { get, set }........................................................................................................................................................... 59
Name { get, set }..................................................................................................................................................... 59
InternalName { get, set } ........................................................................................................................................ 59
DisplayName { get, set } ........................................................................................................................................ 59
Methods ...................................................................................................................................................................... 60
IsValidId ................................................................................................................................................................. 60
IsValidName ........................................................................................................................................................... 60
4.4.2 AutoFormulaReference ........................................................................................................................ 61
Properties .................................................................................................................................................................... 61
Type { get } ............................................................................................................................................................ 61
Parameter { get } .................................................................................................................................................... 61
EnumValue{ get } .................................................................................................................................................. 61
4.4.3 AutoIec61850 ....................................................................................................................................... 62
Properties .................................................................................................................................................................... 62
ObjectName {get, set } ........................................................................................................................................... 62
Hierarchy { get, set } .............................................................................................................................................. 62
DataTypeCategory { get, set } ................................................................................................................................ 62

6
XRIO Automation
DataType { get, set } .............................................................................................................................................. 62
Constraint { get, set } ............................................................................................................................................. 64
4.5 Collections 66
4.5.1 AutoBlocks........................................................................................................................................... 66
Properties .................................................................................................................................................................... 66
Count { get } ........................................................................................................................................................... 66
Indexer .................................................................................................................................................................... 66
Item......................................................................................................................................................................... 66
Methods ...................................................................................................................................................................... 66
Clear ....................................................................................................................................................................... 66
Contains .................................................................................................................................................................. 66
ContainsId............................................................................................................................................................... 66
ItemId ..................................................................................................................................................................... 67
IndexOf ................................................................................................................................................................... 67
Add ......................................................................................................................................................................... 67
Insert ....................................................................................................................................................................... 67
Remove ................................................................................................................................................................... 68
RemoveAt ............................................................................................................................................................... 68
GetEnumerator........................................................................................................................................................ 68
4.5.2 AutoParameters .................................................................................................................................... 69
Properties .................................................................................................................................................................... 69
Indexer .................................................................................................................................................................... 69
Count { get } ........................................................................................................................................................... 69
Item { get } ............................................................................................................................................................. 69
Methods ...................................................................................................................................................................... 69
Clear ....................................................................................................................................................................... 69
Contains .................................................................................................................................................................. 69
ItemId ..................................................................................................................................................................... 69
IndexOf ................................................................................................................................................................... 69
Add ......................................................................................................................................................................... 70
Insert ....................................................................................................................................................................... 70
Remove ................................................................................................................................................................... 70
RemoveAt ............................................................................................................................................................... 70
GetEnumerator........................................................................................................................................................ 70
Example .................................................................................................................................................................. 70
4.5.3 AutoEnumValues ................................................................................................................................. 71
Properties and Indexer................................................................................................................................................. 71
Indexer .................................................................................................................................................................... 71
Count { get } ........................................................................................................................................................... 71
Item { get } ............................................................................................................................................................. 71
Methods ...................................................................................................................................................................... 71
Clear ....................................................................................................................................................................... 71
Contains .................................................................................................................................................................. 71
ItemId ..................................................................................................................................................................... 71
IndexOf ................................................................................................................................................................... 71
Add ......................................................................................................................................................................... 72

7
OMICRON Test Universe
Insert ....................................................................................................................................................................... 72
RemoveAt ............................................................................................................................................................... 72
GetEnumerator........................................................................................................................................................ 72
4.5.4 AutoFormulaReferences ...................................................................................................................... 73
Properties .................................................................................................................................................................... 73
Indexer .................................................................................................................................................................... 73
Count { get } ........................................................................................................................................................... 73
Item { get } ............................................................................................................................................................. 73
Methods ...................................................................................................................................................................... 73
Clear ....................................................................................................................................................................... 73
Contains .................................................................................................................................................................. 73
IndexOf ................................................................................................................................................................... 73
AddParam ............................................................................................................................................................... 73
AddEnumValue ...................................................................................................................................................... 74
RemoveAt ............................................................................................................................................................... 74
GetEnumerator........................................................................................................................................................ 74
Example ...................................................................................................................................................................... 74
4.5.5 AutoCustomDataValues ....................................................................................................................... 75
Properties and Indexer................................................................................................................................................. 75
Indexer .................................................................................................................................................................... 75
Count { get } ........................................................................................................................................................... 75
Item { get } ............................................................................................................................................................. 75
Methods ...................................................................................................................................................................... 75
Clear ....................................................................................................................................................................... 75
ItemId ..................................................................................................................................................................... 75
GetKey.................................................................................................................................................................... 76
Add ......................................................................................................................................................................... 76
RemoveAt ............................................................................................................................................................... 76
4.6 Errors 77
4.6.1 AutoErrorList ....................................................................................................................................... 77
Properties .................................................................................................................................................................... 77
Indexer .................................................................................................................................................................... 77
Item......................................................................................................................................................................... 77
Count { get; }.......................................................................................................................................................... 77
HasScriptErrors { get } ........................................................................................................................................... 77
Methods ...................................................................................................................................................................... 77
Clear ....................................................................................................................................................................... 77
ClearGroup ............................................................................................................................................................. 77
ClearForNode ......................................................................................................................................................... 78
ClearAllScriptErrors ............................................................................................................................................... 78
AddError ................................................................................................................................................................. 78
AddErrorEx ............................................................................................................................................................ 78
HasEnabledFormulaScriptErrors ............................................................................................................................ 78
HasValueFormulaScriptErrors................................................................................................................................ 78
4.6.2 AutoError ............................................................................................................................................. 79
Properties .................................................................................................................................................................... 79

8
XRIO Automation
Column { get }........................................................................................................................................................ 79
Comment { get } ..................................................................................................................................................... 79
Description { get } .................................................................................................................................................. 79
Group { get } .......................................................................................................................................................... 79
GroupText { get } ................................................................................................................................................... 79
Line { get } ............................................................................................................................................................. 79
IdPath { get } .......................................................................................................................................................... 79
IsScriptError { get } ................................................................................................................................................ 80
Number { get } ....................................................................................................................................................... 80
Type { get } ............................................................................................................................................................ 80
TypeText { get } ..................................................................................................................................................... 80
UserPath { get } ...................................................................................................................................................... 80
Methods ...................................................................................................................................................................... 81
IsEnabledFormulaScriptError ................................................................................................................................. 81
IsValueFormulaScriptError .................................................................................................................................... 81
4.7 Access Control 82
4.7.1 Introduction .......................................................................................................................................... 82
4.7.2 AutoAccessControl .............................................................................................................................. 85
Properties .................................................................................................................................................................... 85
IsDocumentReadOnly { get } ................................................................................................................................. 85
Role { get, set } ...................................................................................................................................................... 85
Methods ...................................................................................................................................................................... 85
GetAccess ............................................................................................................................................................... 85
SetAccess................................................................................................................................................................ 86
GetUIProperty ........................................................................................................................................................ 86
SetUIProperty ......................................................................................................................................................... 86
IsTableColumnVisible ............................................................................................................................................ 86
SetShowTableColumn ............................................................................................................................................ 87
SetDefaultValues .................................................................................................................................................... 87
GetRightName ........................................................................................................................................................ 87
GetUIPropertyName ............................................................................................................................................... 87
4.8 Filter Objects 88
4.8.1 AutoFilters ........................................................................................................................................... 88
Properties and Indexer................................................................................................................................................. 88
Indexer .................................................................................................................................................................... 88
Item......................................................................................................................................................................... 88
Count { get } ........................................................................................................................................................... 88
Methods ...................................................................................................................................................................... 88
ItemId ..................................................................................................................................................................... 88
ExecuteImport ........................................................................................................................................................ 88
GetEnumerator........................................................................................................................................................ 89
4.8.2 AutoFilter ............................................................................................................................................. 89
Properties .................................................................................................................................................................... 89
AssemblyPath { get } ............................................................................................................................................. 89
Id { get } ................................................................................................................................................................. 89
IsExportSupported { get } ...................................................................................................................................... 89

9
OMICRON Test Universe
Name { get } ........................................................................................................................................................... 89
Version { get } ........................................................................................................................................................ 89
VersionString .......................................................................................................................................................... 89
Methods ...................................................................................................................................................................... 90
ExecuteExport ........................................................................................................................................................ 90
ExecuteImport ........................................................................................................................................................ 90
GetParameter .......................................................................................................................................................... 90
SetParameter ........................................................................................................................................................... 90
ShowParameterDialog ............................................................................................................................................ 90
4.9 Dependency Objects 91
4.9.1 AutoDependency .................................................................................................................................. 91
Methods ...................................................................................................................................................................... 91
HasBlockDependencies .......................................................................................................................................... 91
HasEnumValueDependencies ................................................................................................................................. 91
HasParameterDependencies.................................................................................................................................... 91
IsBlockUsed ........................................................................................................................................................... 91
IsEnumValueUsed .................................................................................................................................................. 92
IsParameterUsed ..................................................................................................................................................... 92
4.10 Enumerations and Constants 93
4.10.1 DocState ............................................................................................................................................. 93
4.10.2 ErrorGroup ......................................................................................................................................... 93
4.10.3 ErrorType ........................................................................................................................................... 94
4.10.4 NodeType ........................................................................................................................................... 94
4.10.5 ParamDataType .................................................................................................................................. 94
4.10.6 ParamUnitType .................................................................................................................................. 95
4.10.7 ReferenceType ................................................................................................................................... 95
4.10.8 Context ............................................................................................................................................... 95
4.10.9 Rights ................................................................................................................................................. 96
4.10.10 Role .................................................................................................................................................. 96
4.10.11 UIProperties ..................................................................................................................................... 97
4.10.12 ColumnName ................................................................................................................................... 98
4.10.13 CallerType ........................................................................................................................................ 98
4.10.14 OvcCharType ................................................................................................................................... 98
4.10.15 GroundingFactor .............................................................................................................................. 99
4.10.16 Tolerance .......................................................................................................................................... 99
4.10.17 TransducerFunctionType ............................................................................................................... 100
4.10.18 TransducerOuputType .................................................................................................................... 100
5 Appendix ............................................................................................................................ 101
Support .................................................................................................................................. 102

10
XRIO Automation

1 Introduction
OMICRON enhanced its way of modeling Test Object data with the Test Universe version 2.0. The
RIO format ("Relay Interface by OMICRON" - a uniform text format for protective relays) was replaced
and enhanced by the XML based XRIO format ("eXtended RIO").

One subset of XRIO is the modeling of the test object data in a similar way RIO did it (but XML based).
This is the part of the data used directly from the OMICRON Test Modules.

Additionally XRIO has a customizable part, where the user can freely define data using blocks and
parameters. Blocks are collections that can contain other blocks or parameters (comparable to
directories in the file system), parameters are like variables of a simple type (string, integer, floating
point ).

This part can be used to model the test object data as they appear in the user interface of a relay.
These two parts can be combined with formulas so that a user can enter data in the same way, as he
knows it from the relay. XRIO automatically calculates the values in the RIO section, these values are
the TO settings used finally from the test modules.

An XRIO file that models both parts and combines these with formulas is called XRIO Converter.
For a more detailed introduction into the RIO and XRIO topics, see reference [1].

11
OMICRON Test Universe

2 XRio Object Diagram


XRio Filters Filter
+XRioDocument
+XRioFilter 1 0..*
+TestObjectDialog()
+BrowseLinkDialog()
XRioDependency

1
1
AccessControl
XRioDocument CommonData +IsDocumentReadOnly
-CommonData 1 +AccessControl +Role
-RioSupport 1 +SetAccess()
-PredefinedReferences +GetAccess()
-Errors RioSupport +SetUIProperty()
-CustomBlock +GetUIProperty()
-RioBlock 1 +SetShowTableColumn()
-Version +AddRioFunction() +IsTableColumnVisible()
+Load() +SetDefaultValues()
+Save() +...()
PredefinedReferences
+SetActiveRioFunction()
+...() 1 Error
+Group
-Type
Errors
0..* -Number
+Count -Line/Column
+HasScriptErrors -Description
1 +AddError() -IdPath/UserPath
1 +Clear() -IsScriptError
+ClearGroup() +IsValueFormulaScriptError()
+ClearForNode() +IsEnabledFormulaScriptError()
Root
+ClearAllScriptErrors()
+...()

1 1

CUSTOM RIO
-Blocks +Blocks

1 1

-End4 Blocks (Rio)Blocks


-Count
-Indexer
*
+Add()
+Insert()
+Remove() 0..*
+Clear()
+...()
Parameters DEVICE (Block)
+Count 1
+Indexer()
0..* +Add()
+Insert()
+Remove() DISTANCE (Block)
Block +Clear() 1
+Id +...()() 0..*
+Name
0..*
+Enabled
+EnabledFormula
+... Parameter RIOFunction xx (Block)
+Id 0..*
+Name
+Enabled
* -End3 +EnabledFormula
+Value
+ValueFormula
+...

12
XRIO Automation

3 General Hints
The XRIO Automation Interface implements a COM Interface to access the test object document.
Some methods and properties to configure the XRIO editor are also implemented. The most
interesting client to use the Automation interface is the scripting environment within the Omicron
Control Center. Nevertheless, any language that can work with a COM interface can use the XRIO
automation interface.

Annotation to Visual Basic for Applications (VBA) and WinWrap Basic


Most of the examples in this document are written in VBA (Microsoft Excel 2002) or are OCC scripting
examples. The OCC scripting language is "WinWrap Basic". Although it is VBA compatible, keep in
mind the following difference:

Assume a procedure
Sub Test(arg1 As Double, arg2 As Integer)
Debug.Print arg1
Debug.Print arg2
End Sub

WinWrap Basic allows four variants to invoke a procedure:


Test (p1, p2)
Test p1, p2
Call Test(p1, p2)
Call Test p1, p2

Microsoft VBA allows only two variants:


Test p1, p2
Call Test(p1, p2)

3.1 Lifetime of Object References


It is important to understand the lifetime of object references in an XRIO document. You cannot
assume that a reference to an object, for example a block, does not change after loading the test
object until the end of program execution. When the user exits from a dialog with the Cancel button,
the XRio editor destroys objects and creates new objects. To avoid problems with undefined or invalid
references to objects use object references only if you do not call the XRIO editor or examine tests
intermediately.

13
OMICRON Test Universe
Example:
Public Sub AccessBlock
Dim doc As AutoDocument
Dim b As AutoBlock

Set doc = Document.TestObjects(1).Specific.XRioDocument


Set b = doc.CustomBlock.Blocks(1)
MsgBox("Block Id and Name: " + b.Id + " " + b.Name)

Document.TestObjects(1).Activate

MsgBox("Block Id and Name: " + b.Id + " " + b.Name)


End Sub
In the example above, b refers to the first child block of the Custom block. The message box shows
the id and the name of this block.

The next command starts the XRIO editor.


Document.TestObjects(1).Activate

The next line refers to the block by using the field b again. However, b is only a valid reference to the
block object, if the user does not cancel the block detail dialog for this block. Also leaving the editor
with the command "Exit without save" results in an invalid reference to the document. The only way to
avoid this is to reassign the objects after calling foreign code outside of your code.

Document.TestObjects(1).Activate
' Reassign the object references !!!
Set doc = Document.TestObjects(1).Specific.XRioDocument
Set b = doc.CustomBlock.Blocks(1)
MsgBox("Block Id and Name: " + b.Id + " " + b.Name)

3.2 RIO Part Restrictions


The RIO part is a strongly defined structure of blocks and parameters. The structure of the RIO part is
defined by a XML schema and is described in the XRIO reference manual. Normally an automation
client cannot change the id of blocks and parameters or add new blocks or parameters.

3.3 Commit Changes


The XRIO document is a new and additional object layer above the classical test object DLLs for the
various RIO functions. Changes in the XRIO document are not immediately reflected in the objects,
which are used from the test modules. It is important that you use the command CommitChanges to
apply the changes done with automation code to the global test object.
Document.TestObjects(i).CommitChanges
The command CommitChangesTestObject must be used to apply changes to a local test
object.
Document.TestModules(i).CommitChangesTestObject

14
XRIO Automation

3.4 Global and Local Test Object


Another important basic principle in OCC documents is how a test module handles the test object.
Assume an OCC document with a test object and an Overcurrent test module.

(Global) Test Object


Block Custom \ Device Settings
Nominal Voltage VNom100,00 V
Nominal Current INom5,00 A

Test Module
(Local) Test Object
Block Custom \ Device Settings
Nominal Voltage VNom100,00 V
Nominal Current INom5,00 A

Now open the test object dialog for the global test object, change INom to 2 A and add a new
parameter fNom = 50 Hz.
After closing, the report reflects these changes at first only in the global test object.

(Global) Test Object


Block Custom \ Device Settings
Nominal Voltage VNom100,00 V
Nominal Current INom2,00 A
Frequency fNom 50 Hz

Test Module
(Local) Test Object
Block Custom \ Device Settings
Nominal Voltage VNom100,00 V
Nominal Current INom5,00 A

You would get the same result, if the following code were executed:

15
OMICRON Test Universe
' Access to the global test object
' ==================================
Dim doc As AutoDocument
Dim block As AutoBlock
Dim p As AutoParameter
Dim pDouble As Object

Set doc = Document.TestObjects(1).Specific.XRioDocument


Set block = doc.CustomBlock.Blocks(1)
Set pDouble = block.Parameters(2).ParameterDouble
pDouble.InternalValue = 5.0

Set pDouble = block.Parameters.Add(ParamDataType_Real, _


"FNOM").ParameterDouble
pDouble.Description = "Nominal frequency"
pDouble.InternalValue = 50.0
pDouble.Unit = "Hz"
Document.TestObjects(1).CommitChanges

The reason is that a test module gets a copy of the test object whilst activating the test object. This
copy is called the local test object. Therefore, the test module must be activated to get the changes in
the global test object.
In the tested state, the local copy of the test object is read-only and will not be updated during
activation of the test module.

Automation code can also access the local test object and you have write access, as long as the test
module is not in the state "Tested".
' Access to the local test object
' ===============================
Dim doc As AutoDocument
Dim block As AutoBlock
Dim pDouble As Object
Dim d As Double

Document.TestModules(1).Connect
Set doc = Document.TestModules(1).SpecificTestObject.XRioDocument
Set pDouble = doc.CustomBlock.Blocks(1).Parameters(2).ParameterDouble
pDouble.InternalValue = 6
Document.TestModules(1).CommitChangesTestObject
d = pDouble.InternalValue

MsgBox "Changed parameter value in local test object to " + CStr(d)


Document.TestModules(1).Disconnect

With CommitChangesTestObject the new values are applied to the local and the global test
object.

16
XRIO Automation

3.5 Prepare Automation Clients


Omicron Control Center
The OCCenter is a container for a hardware configuration, one or more test objects and test modules.
The OCCenter supports scripting to use the automation interfaces to most of the Test Universe
components.

To get access to the XRIO automation interface execute the following steps.
1. Start OCCenter
2. From the View menu, choose ScriptView.
3. From the Script menu, choose Stop.
4. From the Script menu, choose References. The References dialog box appears.

5. Select the OMICRON XRIO: Data management component


6. Add an event procedure for the desired event, to test some examples use OnCmdSriptRun.
7. Insert Scripting code, for example:

17
OMICRON Test Universe

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

Public Sub OnCmdScriptRun()


Dim doc As AutoDocument
Dim customBlock As AutoBlock
Set doc = Document.TestObjects(1).Specific.XRioDocument
Set customBlock = doc.CustomBlock
ShowBlocks(customBlock)
End Sub

Public Sub ShowBlocks(b As AutoBlock)


Dim i As Integer

For i = 1 To b.Blocks.Count
Debug.Print b.Blocks(i).Name
Next i

End Sub

8. From the Script menu, choose Run/Continue F5


9. The output from Debug.Print is visible in the "Immediate" text area.

19
OMICRON Test Universe

Microsoft Excel VBA


You can use the programming environment of Microsoft Excel (VBA) as automation client.
To get access to the XRIO automation interface execute the following steps.
1. Activate the Visual Basic Toolbar.
2. Choose Visual Basic Editor from the toolbar or from the Tools menu, select Macros and then
Visual Basic Editor.

3. From the Tools menu choose References and select the "OMICRON XRIO Main component" and
the "OMICRON XRIO Data management component".
4. Choose Insert Module and/or Insert Procedure

20
XRIO Automation

Example:
Option Explicit

Dim row As Integer


Dim col As Integer

Sub CreateXRio()

' XRIO application object and XRIO document


Dim xRio As OMXRio.xRio
Dim doc As OMXRioData.AutoDocument

Set xRio = New OMXRio.xRio


Set doc = xRio.XRioDocument

' write the whole XRIO structure to Excel sheet number 2


Call WriteStructureToSheet(doc, 2)

Set doc = Nothing


Set xRio = Nothing

End Sub

Sub WriteStructureToSheet(doc As OMXRioData.AutoDocument, sheetNr As


Integer)

' Select sheet number sheetNr and clear all cells


Sheets(sheetNr).Select
Cells.Select
Selection.ClearContents
Selection.Interior.ColorIndex = xlNone
range("A1").Select

Dim block As OMXRioData.AutoBlock

Set block = doc.CustomBlock


row = 2
col = 1
Call ProcessBlock(block)

Set block = doc.RioBlock


col = 1
Call ProcessBlock(block)

Set block = Nothing

End Sub

21
OMICRON Test Universe
Sub ProcessBlock(block As OMXRioData.AutoBlock)
Dim subBlock As OMXRioData.AutoBlock
Dim p As OMXRioData.AutoParameter
Dim n As Long, i As Long
Dim r As range

' write block data to the worksheet


Debug.Print block.ID, block.Name
col = col + 1 ' increment the indent level

Cells(row, col).Value = block.ID


Cells(row, col + 1).Value = block.Name
Set r = range(Cells(row, col), Cells(row, 10))
With r.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
range("A1").Select

row = row + 1

n = block.Parameters.Count
For i = 1 To n
Set p = block.Parameters.Item(i)
Call ProcessParameter(p)
Next i

' process all subblocks


n = block.Blocks.Count
For i = 1 To n
Set subBlock = block.Blocks.Item(i)
Call ProcessBlock(subBlock)
col = col - 1 ' decrement the indent level
Next i
End Sub

Sub ProcessParameter(p As OMXRioData.AutoParameter)


Dim text As String
Cells(row, col).Value = p.ID
Cells(row, col + 1).Value = p.Name
text = p.DisplayString
Select Case p.DataType
Case OMXRioData.ParamDataType_Real
Cells(row, col + 2).Value2 = CDbl(text)
Case Else
Cells(row, col + 2).Value2 = text
End Select

row = row + 1
End Sub

22
XRIO Automation

C# (Visual Studio 2003)


Create a new C# Project, choose Console Application or Windows Application. Open the Solution
Explorer and right click to references. Browse for OMXRio.dll and OMXRioData.dll and select these
items.

After having done this successfully, the Solution Explorer shows:

A managed .NET application can use the original .NET interfaces and not only the interfaces designed
for an automation client. We strongly recommend that you use the following code as an entry point to
the XRIO application.
using OMXRio;
using OMXRioData;

IAutoXRioTestObject xrio;
IAutoXRioDocument xrioDoc;

xrio = new XRio(); // Create XRio application object


xrioDoc = xrio.XRioDocument; // get the XRIO document

IAutoXRioBlock b = xrioDoc.RioBlock;

23
OMICRON Test Universe

Example:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

using OMXRio;
using OMXRioData;

namespace CSharpClient
{
public class FormMain : System.Windows.Forms.Form
{
IAutoXRioTestObject xrio;
IAutoXRioDocument xrioDoc;
string intent = "";

private System.Windows.Forms.TextBox textOutput;


private System.Windows.Forms.Button btnEdit;
private System.Windows.Forms.Button btnShow;

private System.ComponentModel.Container components = null;

public FormMain()
{
InitializeComponent();
}

protected override void Dispose( bool disposing )


{

}

#region Windows Form Designer generated code


private void InitializeComponent()
{
.
}

[STAThread]
static void Main()
{
Application.Run(new FormMain());
}

24
XRIO Automation
void BlockProperties(OMXRioData.IAutoXRioBlock b)
{
string text = intent + String.Format(
"{0,8} : {1}\r\n", b.Id, b.Name);
textOutput.Text += text;

intent += " ";


IAutoXRioBlocks blocks = b.Blocks;
for (int i = 1; i <= blocks.Count; i++)
{
BlockProperties(blocks[i]);
}
intent = intent.Substring(2);
IAutoXRioParameters parameters = b.Parameters;
intent += " ";
for (int i = 1; i <= parameters.Count; i++)
{
ParameterProperties(parameters[i]);
}
intent = intent.Substring(2);
}

void ParameterProperties(OMXRioData.IAutoXRioParameter p)
{
string text = intent + String.Format(
"{0,8} : {1} = {2}\r\n", p.Id, p.Name, p.DisplayString);
}

private void FormMain_Load(object sender, System.EventArgs e)


{
xrio = new XRio(); // Create XRio application object
xrioDoc = xrio.XRioDocument; // get the XRIO document
}

private void btnEdit_Click(object sender, System.EventArgs e)


{
xrio.TestObjectDialog(this.Handle.ToInt32());
}

private void btnShow_Click(object sender, System.EventArgs e)


{
intent = "";
textOutput.Text = "";
IAutoXRioBlock b = xrioDoc.RioBlock;
BlockProperties(b);
}

}
}

25
OMICRON Test Universe

4 Object Reference
4.1 Application
4.1.1 XRio
XRio is the top-level application object for using XRIO automation.

Properties:
XRioDocument { get }
Syntax: object.XRioDocument
Type: AutoDocument
Description: Gets the XRio document
Example:
Dim xRio As OMXRio.xRio
Dim doc As OMXRioData.AutoDocument

Set xRio = New OMXRio.xRio


Set doc = xRio.XRioDocument
XRioFilters { get }
Syntax: object.XRioFilters
Type: AutoFilters
Description: Gets the XRio filter object
XRioDependency { get }
Syntax: object.XRioDependency
Type: AutoDependency
Description: Gets the XRio dependency object

Methods:
TestObjectDialog
Syntax: object.TestObjectDialog(long ownerWindow)
Return Type: bool
Description: Starts the standard user interface to show, modify, load and store XRio
documents.
Example: success = xRio.TestObjectDialog(0)

26
XRIO Automation

BrowseLinkDialog
Syntax: object.BrowseLinkDialog(string paramPath, string paramName, long
ownerWindow, double min, double max, double factor, bool readOnly)
Return Type: bool
Description: This dialog window is used from test modules to link test parameters to a test
object parameter. You can use this functionality from an automation client as
well. There may be use cases for this dialog.

Example:
Sub BrowseLinkDialog(xRio As OMXRio.xRio)

Dim paramPath As String


Dim paramName As String
Dim factor As Double
Dim success As Boolean
Dim ownerWindow As Long

paramPath = ""
paramName = ""
factor = 1#

success = xRio.BrowseLinkDialog(paramPath, paramName, _


0, 0#, 100#, factor, False)

Debug.Print success, paramPath, paramName, factor

End Sub

BrowseLinkBoolDialog
Description: The same as BrowseLinkDialog with the difference that this dialog gets used to
link Boolean values

27
OMICRON Test Universe

4.2 Document

4.2.1 AutoDocument
An XRIO document is a container for test object parameters. Parameters are members of a block. A
block can also contain additional blocks in a parent child relation. The structure of an XRIO document
is a tree, with block nodes and parameters as leaves.

To show the syntax, the following reference of all document properties and document methods
assumes that we have an XRIO document object with name doc.

28
XRIO Automation

Properties:
Version { get }
Syntax: doc.Version
Type: string
Description: Gets the version of the XRio document. Version 1.0 was released with TU 2.0,
version 2.1.0 with TU 2.1
Root { get }
Syntax: doc.Root
Type: AutoBlock
Description: Gets the root (block) of the XRio document.
CustomBlock { get }
Syntax: doc.CustomBlock
Type: AutoXRioBlock
Description: Gets the Custom block of the XRio document.
RioBlock { get }
Syntax: doc.RioBlock
Type: AutoBlock
Description: Gets the Rio block of the XRio document.
CommonData { get }
Syntax: doc.CommonData
Type: AutoCommonData
Description: Gets the CommonData object. Use the CommonData object to use the
access control component. This component allows customizing the XRio editor
for two kinds of user modes (tester and designer).
Errors { get }
Syntax: doc.Errors
Type: AutoErrorList
Description: Gets the list of error entries.
Several errors and warnings are logged into an error list. Most error entries are
produced during the schema validation of an XRio file or in the phase of
compiling the script code, which is used to implement the formulas for data
values and enabled conditions.
Example: see AutoErrorList
PredefinedReferences { get }
Syntax: doc.PredefinedReferences
Type: AutoFormulaReference
Description: Gets the collection of predefined formula references.

29
OMICRON Test Universe

RioSupport { get }
Syntax: doc.RioSupport
Type: AutoSupport
Description: Gets a reference to the RioSupport object. This object implements a method
to add RIO functions.
Example:
Dim rioSupport As AutoRioSupport
rioSupport = doc.rioSupport
rioSupport.AddRioFunction (NodeType_Meter)

Methods:
CreateNew
Syntax: doc.CreateNew
Return Type: void
Description: Deletes the whole document and creates a new document with an empty
CUSTOM block and a DEVICE block inside the RIO block. All parameters in the
device block are initialized with default values.
LoadFromFile
Syntax: [result = ] doc.LoadFromFile(string filePath)
Return Type: DocState
Description: Loads an XRio document from a XRio file (XML).
Return Value: DocState_FatalError if the file does not exist or if the file is not a well formed
XML file.
DocState_Warning if the file has errors.
DocState_NoError if the file was read without an error.
Example (VBA):
Dim xRio As OMXRio.xRio
Dim doc As OMXRioData.AutoDocument
Dim docError As OMXRioData.DocState

Set xRio = New OMXRio.xRio


Set doc = xRio.XRioDocument

docError = doc.LoadFromFile("D:\XRioExamples\Example01.xrio")
Debug.Print docError
If (docError = OMXRioData.DocState_FatalError) Then
Exit Sub
End If

doc.CreateNew

30
XRIO Automation

LoadFromString
Syntax: [result = ] doc.LoadFromString(string xRioString)
Return Type: DocState
Description: Loads a document from a string containing the XML document.
Return Value: see LoadFromFile
LoadTextRioFromFile
Syntax: state = LoadTextRioFromFile(string filePath)
Return Type: DocState
Description: Load a RIO document from a file. Use this method to load files with the original
RIO format.
LoadTextRioFromString
Syntax: state = LoadTextRioFromFile(string rioString)
Return Type: DocState
Description: Load a RIO document from a string.
SaveToFile
Syntax: [result = ] doc.SaveToFile(string filePath)
Return Type: bool
Description: Writes the current document to a XRIO file. This is an XML file. Note: Use .xrio
as file extension.
Return Value: True, if the file was successfully saved, otherwise false.
SaveToString
Syntax: [result = ] doc.SaveToString(string xRioString, bool isXRioExport)
Return Type: bool
Description: Writes the XRIO document in XML format into a string. If isXRioExport is
True, then the document is stored with the whole content (multiple function
blocks, disabled blocks and parameters).
SaveTextRioToFile
Syntax: success = SaveTextRioToFile(string filePath)
Return Type: bool
Description: XRio supports import and export of RIO files. Use this method to save the
current XRio document as RIO file. Note: The new XRio features (multiple test
object functions, formulas) are discarded during the transformation to RIO. Only
active functions and enabled blocks and parameters will be exported. The
resulting RIO file does not contain custom blocks and script code and does not
contain formulas.
SaveTextRioToString
Syntax: success = SaveTextRioToString (string rioString)
Return Type: bool
Description: Same as above, but the target is a string.

31
OMICRON Test Universe

GetGlobalScript
Syntax: result = doc.GetGlobalScript()
Return Type: string
Description: An XRio document (converter) can contain a script section with Visual
Basic .NET code. This method returns this script code.
Example (VBA):
Dim script As String
script = doc.GetGlobalScript()
SetGlobalScript
Syntax: doc.SetGlobalScript(string script, bool debug)
Return Type: void
Description: Set the Visual Basic .NET code stored in the string Script as script code. This
call starts the script compiler. Use debug = true to force a compilation in debug
mode.
GetBlockFromIDs
Syntax: b = GetBlockFromIDs(string blockPath)
Return Type: AutoXRioBlock
Description: Each block in the document has a unique pathname to identify it. The pathname
is the concatenation of the block ID's from the document root to the block. A
point is used as level separator.
Example:
Dim b as OMXRioData.AutoBlock
Dim p as OMXRioData.AutoParameter
b = doc.GetBlockFromIDs("RIO.DEVICE.LIMITS")
For Each p In b.Parameters
Debug.Print p.Name; " = "; p.DisplayString
Next p
GetParamFromIDs
Syntax: p = doc.GetParamFromIDs(string paramPath)
Return Type: AutoParameter
Description: Each parameter in the document hierarchy is clearly defined with an absolute
pathname of type "blockId.blockIdparamaterId". This method
returns a reference to the parameter with the given path or null (Nothing) if the
parameter doesn't exist.
Example:
Dim p as AutoXRioParameterDouble
pDouble = doc.GetBlockFromIDs("RIO.DEVICE.LIMITS.IMAX")
Set pDouble = _
doc.GetParamFromIDs("RIO.DEVICE.LIMITS.IMAX").ParameterDouble
Debug.Print pDouble.Name; " = "; pDouble.InternalValue; pDouble.Unit

32
XRIO Automation

GetEnumValueFromIDs
Syntax: enumValue = doc.GetEnumValueFromIDs(string enumValuePath)
Return Type: AutoEnumValue
Description: A parameter of type enumeration has an associated list of valid enumeration
values. This list defines a collection of key (ID) and display value pairs. The ID-
path to the parameter together with the enumeration ID is a unique path to one
of the defined enumeration values.
GetIDsPathFromBlock
Syntax: path = doc.GetIDsPathFromBlock(AutoBlock b)
Return Type: string
Description: Gets the ID path of a block object. Use a reference to the block object as
argument.
GetIDsPathFromParam
Syntax: path = doc.GetIDsPathFromParam(AutoParameter p)
Return Type: string
Description: Gets the ID path of a parameter object. Use a reference to the parameter object
as argument.
GetIDsPathFromEnumValue
Syntax: path = GetIDsPathFromEnumValue(AutoEnumValue enumValue)
Return Type: string
Description: Gets the ID path of an enumeration value object. Use a reference to the
enumeration value object as argument.
GetUserPathFromBlock
Syntax: path = doc.GetUserPathFromBlock(AutoBlock b)
Return Type: string
Description: Gets the concatenation of all block names from the root to the specified block
as a path expression. Note that the names of blocks and parameters are
localized. To identify blocks use the ID path.
GetUserPathFromParam
Syntax: path = doc.GetUserPathFromParam(AutoParameter p)
Return Type: string
Description: Gets the user path (block names and parameter name) for a given parameter.
GetUserPathFromEnumValue
Syntax: GetUserPathFromEnumValue(AutoEnumValue enumValue)
Return Type: string
Description: Gets the user path (block names and parameter name) for a given enumeration
value.

33
OMICRON Test Universe

HasRioFunction
Syntax: result = doc.HasRioFunction(NodeType blockType)
Return Type: bool
Description: Returns true if the document has a test object function of the given type,
otherwise returns false.
Example:
result = doc.HasRioFunction(NodeType_Distance)
ClearAllActiveRioFunctions
Syntax: ClearAllActiveRioFunctions()
Return Type: void
Description: Sets the first function in the function collection as the active test object function.
Example:
Active functions before and after ClearAllActiveRioFunctions
Before After
DEVICE DEVICE
DISTANCE1 DISTANCE1
DISTANCE2 DISTANCE2
VISTARTING1 VISTARTING1
VISTARTING2 VISTARTING2
VISTARTING3 VISTARTING3

GetActiveRioFunction
Syntax: block = GetActiveRioFunction(NodeType blockType)
Return Type: AutoBlock
Description: Gets the current active RIO function for the specified function.
Example (VBA):
Sub ActiveRioFunction(doc As OMXRioData.AutoDocument)

Dim b As OMXRioData.AutoBlock

Set b = doc.GetActiveRioFunction(NodeType_Distance)
Debug.Print "Active function is "; b.ID
Set b = doc.SetActiveRioFunction(NodeType_Distance, "DISTANCE2")
Set b = doc.GetActiveRioFunction(NodeType_Distance)
Debug.Print "Active function is "; b.ID

End Sub

34
XRIO Automation

SetActiveRioFunction
Syntax: SetActiveRioFunction(NodeType blockType, string id)
Return Type: AutoBlock
Description: An XRio document can contain multiple function blocks, for example three
DISTANCE function blocks. Only one of these DISTANCE test objects is the
currently used (active) one. Use this method to select one of the available
function blocks as the active test object function.

4.2.2 AutoRioSupport
Methods
AddRioFunction
Syntax: AddRioFunction (NodeType type)
Return Type: AutoBlock
Description: Adds a RIO function with the specified type and with initial default settings.
Example: doc.RioSupport.AddRioFunction (NodeType_Differential)

4.2.3 AutoCommonData
Properties
AccessControl { get }
Syntax: commonData.AccessControl
Type: AutoAccessControl
Description: Gets a reference to the AccessControl object.
IsInputFormatInfoUser { get, set }
Syntax: commonData.IsInputFormatInfoUser
Type: bool
Description: Gets or sets a flag to specify whether formatting settings (decimal symbol) from
the user specific regional settings are used to parse inputs.
This feature is obsolete because period and colon are accepted as decimal
symbol.
IsOutputFormatInfoUser { get, set }
Syntax: commonData.IsOutputFormatInfoUser
Type: bool
Description: Gets or sets a flag to specify, whether formatting settings (decimal symbol) from
the user specific regional settings are used to produce outputs.
This is an obsolete and unsupported feature.

35
OMICRON Test Universe

4.3 Document Nodes - Blocks and Parameters


The XRIO document structure is a tree with blocks to hold a collection of further blocks and/or
parameters. Parameters with all its properties are the end nodes or leaves of the tree.
Blocks and Parameters have some common properties, for example an identifier (Id) and a name. The
code behind the automation interface is constructed in such a way, that blocks and parameters are
derived from a class ElementNode and ElementNode is derived from a base class Node.

Simplified Class Node


Diagram: Id: string
Name: string
Type: NodeType
...
IsValidId(string id) bool
IsValidName(string name): bool
IsParentOf (Object node): bool
...

ElementNode
Description: string
Enabled: bool
EnabledFormula: string
HasEnabledFormula: bool
EnabledRefererences: FormulaReferences
...

Block Parameter
ParentElementNode: Block DataType: ParamDataType
Blocks: BlockCollection DisplayString: string
Parameters: ParameterCollection ValueFormula: string
HasValueFormula: bool
ValueReferences: FormulaReferences
...
SetDisplayValue(value: string) : bool
...

Parameter Parameter Parameter Parameter


String Boolean Integer Real

36
XRIO Automation

4.3.1 AutoBlock and AutoParameter


This section describes the common properties for blocks and parameters. The Syntax description uses
the term node as placeholder for a block or parameter object.

Properties
Id {get, set}
Syntax: node.Id
Type: string
Description: Get or set the Id of a block or parameter. The rules for identifiers are the rules
for identifiers in VB.Net. VB.Net identifiers are not case sensitive, XRio allows
only Ids with uppercase letters. The Id must be unique for the collection of child
blocks inside a block and for the parameter collection within a block. XRio uses
the concatenation of the Ids with a point as delimiter as an unambiguous path to
reference a block or parameter.
Name {get, set}
Syntax: node.Name
Type: string
Description: Get or set the name of a block or parameter. This property is only used as an
expressive name for the user. Names should be unique inside a collection but
they must not be unique. There are some slight restrictions to prevent problems,
if the language is switched between the various languages supported by Test
Universe. The name could be localized.
Description { get, set }
Syntax: node.Description
Type: string
Description: Gets or sets the description of a node. This data field can be used to describe
the block or parameter.
Type {get}
Syntax: node.Type
Type: NodeType
Description: Gets the type of a node. The data type NodeType is an enumeration. Important
node types are NodeType_Custom for blocks in the custom section of XRio
(custom blocks), NodeType_Parameter for parameters. All blocks inside
the RIO section have different node types.
ParentElementNode {get}
Syntax: node.ParentElementNode
Type: AutoBlock
Description: Gets the parent node of a block or parameter.

37
OMICRON Test Universe

Enabled { get, set }


Syntax: node.Enabled
Type: bool
Description: Gets or sets a value indicating whether the node is enabled.
Example:
EnabledFormula { get, set }
Syntax: node.EnabledFormula
Type: string
Description: Gets or sets a formula to calculate the Enabled attribute.
Example:
Dim p As OMXRioData.AutoParameter
Dim path As String

path = "CUSTOM.B1.PHASES"
Set p = doc.GetParamFromIDs(path)

Debug.Print "Block enabled: "; myBlock.Enabled


myBlock.EnabledReferences.Clear
Call myBlock.EnabledReferences.AddParam( _
"N_PHASES", "CUSTOM.B1.PHASES", p)
myBlock.EnabledFormula = "N_PHASES > 2"
HasEnabledFormula { get }
Syntax: node.HasEnabledFormula
Type: bool
Description: Gets a value indicating whether the node has a formula for the enabled flag.
EnabledReferences { get;}
Syntax: node. EnabledReferences
Type: AutoFormulaReferences
Description: Gets the collection of references used from the formula for the enabled flag.
CustomDataValues { get }
Syntax: node.CustomDataValues
Type: AutoCustomDataValues
Description: Gets an object reference to collection of key value pairs. This collection can be
used to store additional information for blocks and parameters. Also new since
version 2.1.

38
XRIO Automation

ForeignId { get, set }


Syntax: node.ForeignId
Type: string
Description: Gets or sets a custom identifier for a node. Use this attribute to store the original
name/identifier for a function block or parameter used in the documentation of
the device. This attribute is new in XRio Version 2.1 and has no relevancy for
the XRio functionality (for example as a known name in a formula).
Iec61850 { get }
Syntax: node.Iec61850
Type: AutoIec61850
Description: Gets an object reference to the optional Iec61850 object. If the object does not
exist, an object is created. The Iec61850 object encapsulates some data fields
to store Iec61850 related information.
New since XRio 2.1, see also: Iec61850 object
UserComment { get, set }
Syntax: block.UserComment
Type: string
Description: Gets or sets the user comment. New since version 2.1

Methods
IsParentOf
Syntax: node.IsParentOf(node childNode)
Return Type: bool
Description: Determines whether the node is the parent of a specific childNode.

39
OMICRON Test Universe

IsValidId
Syntax: node.IsValidId(string Id)
Return Type: bool
Description: Determines whether an Id is valid. IsValidId and IsValidName check
only the principal rules for identifiers and names. IsValidId does not check
whether the Id is already used in the current collection.
Example:
Set block = doc.GetBlockFromIDs("CUSTOM.B2.B1")
Debug.Print block.IsValidId("F1")
Debug.Print block.IsValidId("f1")
Debug.Print block.IsValidId("1Phase")
Debug.Print block.IsValidId("IF")
Output from this example code:
True
False Lowercase letters are not allowed.
False Identifier must begin with a letter.
False IF is a Visual Basic key word.
IsValidName
Syntax: node.IsValidName(string name)
Return Type: bool
Description: Determines whether the name is a valid name. Names are Unicode strings with
some minor restrictions to prevent problems with localized versions of Test
Universe.

40
XRIO Automation

4.3.2 AutoBlock
A block is the most important means to build a hierarchical structure of blocks, child blocks and
parameters. A block is like a folder, which contains parameters and blocks of the next level.

Properties
Blocks { get }
Syntax: block.Blocks
Type: AutoBlocks
Description: Gets a reference to the collection of child blocks.
Parameters { get }
Syntax: block.Parameters
Type: AutoParameters
Description: Gets a reference to the collection of parameters.
Example:
Dim xRio As OMXRio.xRio
Dim doc As OMXRioData.AutoDocument
Dim block As OMXRioData.AutoBlock
Dim myBlock As OMXRioData.AutoBlock
Dim p As AutoParameter
Dim errorMsg As String
Dim result As Boolean

Set xRio = New OMXRio.xRio


Set doc = xRio.XRioDocument

Set block = doc.CustomBlock

block.Blocks.Clear
Set myBlock = block.Blocks.Add("PARAMETERS")
myBlock.Name = "Parameters"
Set p = myBlock.Parameters.Add(ParamDataType_Boolean, "ARCENABLED")
result = p.SetDisplayValue("True", errorMsg)

Set myBlock = block.Blocks.Add("EARTHFAULT")


Set myBlock = block.Blocks.Add("AUTORECLOSE")
IsRioFunction { get }
Syntax: block.IsRioFunction
Type: bool
Description: Returns true if the block is a RIO function. Rio functions are the DEVICE block
and the specific test objects, defined by several test modules (DISTANCE,
DIFFERENTIAL, OVERCURRENT, ). All RIO functions are child blocks of the
RIO block.

41
OMICRON Test Universe

42
XRIO Automation

ExternalEditorExist { get }
Syntax: block.ExternalEditorExist
Type: bool
Description: The XRio editor shows the XRio block structure in a tree and the parameters in
a table and has the functionality to change all the attributes of blocks and
parameters. On the other side, the well-known test object dialogs (external
editor) to set up the test object properties are still part of the Test Universe
software package. These test object dialogs implement the logic of the test
object and ensure valid settings. These dialogs are not always available. For
example, an OVERCURRENT standalone test module does not have an editor
for the DISTANCE function. The property ExternalEditorExist returns true, if a
specific editor for the current block (RIO function) exist and is available.
SuppressPrintOut { get, set }
Syntax: block.SuppressPrintOut
Type: bool
Description: Flag to suppress printout within TU (for the reporting)

43
OMICRON Test Universe

AutoParameter
XRIO supports different parameter types for values of type "real number" or "double", "integer
numbers", "boolean values", "string" and "enumeration". Internally the classes for these types are
derived from a class "Parameter". AutoParameter implements the properties and methods of the
Parameter class. All these properties and methods are also valid for the objects AutoParameterDouble,
AutoParameterInteger, AutoParameterBoolean, AutoParameterString and AutoParameterEnum.

Properties
DataType { get }
Syntax: p.DataType
Type: ParamDataType
Is one of: ParamDataType_Invalid, ParamDataType_String,
ParamDataType_Enumeration, ParamDataType_Boolean,
ParamDataType_Integer, ParamDataType_Real
Description: Gets the data type of the parameter.
DisplayString { get }
Syntax: p.DisplayString
Type: string
Description: Gets a string representing the current parameter value.
DisplayReferenceString { get }
Syntax: p.DisplayReferenceString
Type: string
Description: Gets a string representing the current reference value.
ValueFormula { get, set }
Syntax: p.ValueFormula
Type: string
Description: Gets or sets the optional formula used to calculate the value from other
parameters.
HasReferenceValue { get, set }
Syntax: p.HasReferenceValue
Type: bool
Description: Gets or sets if a parameter has a reference value;
HasValueFormula { get }
Syntax: p.HasValueFormula
Type: bool
Description: Determines whether the specified parameter has a value formula.
ValueReferences { get }
Syntax: p.ValueReferences
Type: AutoFormulaReferences
Description: Gets a reference to the collection of formula references used in the formula.

44
XRIO Automation

ParameterBoolean { get }
Syntax: p.ParameterBoolean
Type: AutoParameterBoolean
Description: Gets a reference to the AutoParameterBoolean object associated with the
parameter p.

45
OMICRON Test Universe

ParameterDouble { get }
Syntax: p.ParameterDouble
Type: AutoParameterDouble
Description: Gets a reference to the AutoParameterDouble object associated with the
parameter p.
ParameterEnum { get }
Syntax: p.ParameterEnum
Type: AutoParameterEnum
Description: Gets a reference to the AutoParameterEnum object associated with the
parameter p.
ParameterInteger { get }
Syntax: p.ParameterInteger
Type: AutoParameterInteger
Description: Gets a reference to the AutoParameterInteger object associated with the
parameter p.

46
XRIO Automation

ParameterString { get }
Syntax: p.ParameterString
Type: AutoParameterString
Description: Gets a reference to the AutoParameterString object associated with the
parameter p.
Example:
Dim i As Integer
Dim pString As AutoParameterString
Dim pInt As AutoParameterInteger
Dim pDouble As AutoParameterDouble
Dim pBool As AutoParameterBoolean
Dim pEnum As AutoParameterEnum

Debug.Print "List of Parameters"


For i = 1 To myBlock.Parameters.Count
Debug.Print i, myBlock.Parameters(i).ID
Set p = myBlock.Parameters(i)
Select Case p.DataType
Case ParamDataType_String
Set pString = p.ParameterString
pString.ParameterValue = "Omicron"
Case ParamDataType_Boolean
Set pBool = p.ParameterBoolean
pBool.ParameterValue = False
Case ParamDataType_Integer
Set pInt = p.ParameterInteger
pInt.MaxValue = 0
pInt.MaxValue = 10
pInt.ParameterValue = 5
Case ParamDataType_Real
Set pDouble = p.ParameterDouble
pDouble.InternalMin = 0#
pDouble.InternalMax = 10#
pDouble.InternalValue = 2.45
Case ParamDataType_Enumeration
Set pEnum = p.ParameterEnum
Call pEnum.EnumValues.Add("F50", "50 Hz")
Call pEnum.EnumValues.Add("F60", "60 Hz")
pEnum.ParameterValue = "F60"
End Select
Next i

47
OMICRON Test Universe

Methods
SetDisplayValue
Syntax: p.SetDisplayValue (string newValue, out string errorText)
Return Type: bool
Description: Accepts a string representation of the value to set a new value.
Return Value: true if the string is converted successfully and the value is a valid value
according to the data type and the limits of the parameter value; otherwise,
false
SetDisplayReferenceValue
Syntax: p.SetDisplayReferenceValue(string newValue, out string errorText)
Return Type: bool
Description: Accepts a string representation of the reference value to set a new reference
value
Return type: true if the string is converted successfully and the value is a valid value
according to the data type and the limits of the parameter value; otherwise false

Valid strings (literals) for the different data-types:

Data type Comments / Literals


String Any Unicode string.
Double The display string must be a valid floating point literal,
representing the number calculated from the internal
value and the multiplier symbol. If the multiplier symbol is
'm' and you set the internal value to 5E-3, then the display
value is "5".
A floating-point literal is an integer literal followed by an
optional decimal point (the ASCII period character) and
mantissa, and an optional base 10 exponent.
SetDisplayValue also accepts a comma as decimal point.
Note: You cannot use thousand separators.
Examples for valid literals:
"2", "3.1415", "3,1415", "110E3", "5E-3"
Integer A sequence of decimal digits.
Boolean "true", "yes", "1"
"false", "no", "0"
Also uppercase letters are allowed.
Enumeration One of the names defined in the collection of enumeration
values.

48
XRIO Automation

Example:
Sub AddParameters(b As AutoBlock)

Dim p As AutoParameter
Dim errorText As String
Dim success As Boolean

Set p = b.Parameters.Add(ParamDataType_Real, "VNOM")


p.Name = "Vnom"
p.Description = "Nominal voltage"
p.ParameterDouble.Unit = "V"
success = p.SetDisplayValue("100", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If

Set p = b.Parameters.Add(ParamDataType_Real, "VPRIM")


p.Name = "Vnom"
p.Description = "Primary voltage"
p.ParameterDouble.MultiplierSymbol = Asc("k")
p.ParameterDouble.Unit = "V"
success = p.SetDisplayValue("110", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If
Debug.Print p.ParameterDouble.InternalValue

Set p = b.Parameters.Add(ParamDataType_Real, "INOM")


p.Name = "Inom"
p.Description = "Nominal current (2.5 A)"
p.ParameterDouble.Unit = "A"
success = p.SetDisplayValue("2.5", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If
Debug.Print p.ParameterDouble.InternalValue

Set p = b.Parameters.Add(ParamDataType_Integer, "PHASES")


p.Name = "Phases"
p.Description = "Number of phases (1 to 3)"
success = p.SetDisplayValue("3", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If

49
OMICRON Test Universe
Set p = b.Parameters.Add(ParamDataType_String, "DEVICE_TYPE")
p.Name = "Type"
success = p.SetDisplayValue("5Q213", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If

Set p = b.Parameters.Add(ParamDataType_Boolean, "ARCENABLED")


p.Name = "ARC enabled"
success = p.SetDisplayValue("yes", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If

Set p = b.Parameters.Add(ParamDataType_Enumeration, "CT_CONNECTION")


Dim pEnum As AutoParameterEnum
Set pEnum = p.ParameterEnum
pEnum.EnumValues.Add("BUS", "At bus")
pEnum.EnumValues.Add("LINE", "At Line")
success = p.SetDisplayValue("At Line", errorText)
If Not success Then
Call MsgBox("Could not set display value", vbInformation, "Error")
End If

Set p = b.Parameters.Add(ParamDataType_Real, "CB_CLOSETIME")


p.Name = "TCBClose"
p.Description = "Circuit breaker closing time"
p.ParameterDouble.Unit = "s"
success = p.SetDisplayValue("5E-3", errorText)
Debug.Print p.ParameterDouble.InternalValue
p.ParameterDouble.MultiplierSymbol = Asc("m")
success = p.SetDisplayValue("6", errorText)
Debug.Print p.ParameterDouble.InternalValue

End SubAutoParameterBoolean

50
XRIO Automation

4.3.3 AutoParameterDouble
Properties
InternalValue { get, set }
Syntax: p.InternalValue
Type: double
Description: Gets or sets the internal double precision value of the specified parameter.
Note: internalMin <= newValue <= internalMax
InternalReferenceValue { get, set }
Syntax: p.InternalReferenceValue
Type: double
Description: Gets or sets the internal double precision reference value of the specified
parameter. Note: internalMin <= newReferenceValue <= internalMax
InternalMin { get, set }
Syntax: p.InternalMin
Type: double
Description: Gets or sets the internal double precision minimal value of the specified
parameter.
InternalMax { get, set }
Syntax: p.InternalMax
Type: double
Description: Gets or sets the internal double precision maximum value of the specified
parameter.
MultiplierSymbol { get, set }
Syntax: p.MultiplierSymbol
Type: char or int (in WinWrap Basic)
Description: Gets or sets the multiplier used for the string representation of the value. Valid
multiplier symbols are 'u' or '' (10-6), 'm' (10-3), ' ' [blank] (100), k (10+3), M (10+6),
G (10+9)
Example: p.MultiplierSymbol = Asc("m")
Unit { get, set }
Syntax: p.Unit
Type: string
Description: Gets or sets the unit for the specified parameter.

51
OMICRON Test Universe

DecimalPlaces { get, set }


Syntax: p.DecimalPlaces
Type: int
Description: Gets or sets the number of digits after the decimal point used for the string
representation (see DisplayValue) of the value.
Parameter { get }
Syntax: p.Parameter
Type: AutoParameter
Description: Gets a reference to the AutoParameter object associated with the parameter p.

52
XRIO Automation

Methods
IsValidInternalValue
Syntax: p.IsValidInternalValue(double newDouble, out string errorText)
Parameters: newDouble: The double number containing the data to test.
errorText: A string containing information about the validation error.
Description: Gets a value indicating whether newDouble is a valid internal value.
Condition: internalMinValue <= newInternalValue <= internalMaxValue
Return Type: bool
Return Value: true if newDouble is valid; otherwise false
IsValidInternalMinValue
Syntax: p.IsValidInternalMinValue(double newDouble, out string errorText)
Parameters: newDouble: The double number containing the data to test.
errorText: A string containing information about the validation error.
Description: Gets a value indicating whether newDouble is a valid internal minimum value.
Condition: newInternalMinValue <= internalValue
Return Type: bool
Return Value: true if newDouble is valid; otherwise false
IsValidInternalMaxValue
Syntax: p.IsValidInternalMaxValue(double newDouble, out string errorText
Parameters: newDouble: The double number containing the data to test.
errorText: A string containing information about the validation error.
Description: Gets a value indicating whether newDouble is a valid internal maximum value.
Condition: newInternalMaxValue >= internalValue
Return Type: bool
Return Value: true if newDouble is valid; otherwise false
IsValidMultiplierSymbol
Syntax: p.IsValidMultiplierSymbol (char c, out string errorText)
Parameters: c: The character to test.
errorText: A string containing information about the validation error.
Description: Gets a value indicating whether the character c is a valid multiplier symbol.
Return Type: bool
Return Value: true if c is a valid multiplier; otherwise false

53
OMICRON Test Universe

4.3.4 AutoParameterInteger
Properties
ParameterValue { get, set }
Syntax: p.ParameterValue
Type: int
Description: Gets or sets the value of the specified parameter.
ParameterReferenceValue { get, set }
Syntax: p.ParameterReferenceValue
Type: int
Description: Gets or sets the reference value of the specified parameter.
MinValue { get, set }
Syntax: p.MinValue
Type: int
Description: Gets or sets the minimum value for the specified parameter.
MaxValue { get, set }
Syntax: p.MaxValue
Type: int
Description: Gets or sets the maximum value for the specified parameter.
Unit { get, set }
Syntax: p.Unit
Type: string
Description: Gets or sets the unit for the specified parameter. The unit is only used to display
the values together with a unit.
Parameter { get }
Syntax: p.Parameter
Type: AutoParameter
Description: Gets a reference to the AutoParameter object associated with the parameter p.

Methods
IsValidValue
Syntax: p.IsValidValue (int newInt, out string errorText)
Type: bool
Description: Gets a value indicating whether newInt is a valid value for the specified
parameter.

54
XRIO Automation

IsValidMinValue
Syntax: p. IsValidMinValue (int newInt, out string errorText)
Type: bool
Description: Gets a value indicating whether newInt is a valid internal minimum value.

55
OMICRON Test Universe

IsValidMaxValue
Syntax: p.IsValidMaxValue (int newInt, out string errorText)
Type: bool
Description: Gets a value indicating whether newInt is a valid internal maximum value.

Example:
Sub ParameterIntegerDemo(b As AutoBlock)

Dim p As AutoParameterInteger
Dim msg As String

Debug.Print "= ParameterIntDemo =============="

Set p = b.Parameters.Add(ParamDataType_Integer, _
"DARSHOTE").ParameterInteger
p.Name = "DARShot E"
p.Description = "Number of permissible DAR shots after earth fault"
p.ParameterValue = 4

If (p.IsValidMinValue(0, msg)) Then


p.MinValue = 0
Else
Debug.Print msg
End If
Debug.Print p.MinValue; p.ParameterValue; p.MaxValue

If (p.IsValidMaxValue(3, msg)) Then


p.MaxValue = 3
Else
p.MaxValue = p.ParameterValue
End If
Debug.Print p.MinValue; p.ParameterValue; p.MaxValue

If (p.IsValidValue(10, msg)) Then


p.ParameterValue = 10
Else
Debug.Print msg
End If
Debug.Print p.MinValue; p.ParameterValue; p.MaxValue

Dim pp As AutoParameter
Set pp = p.Parameter
Debug.Print "DataTypeNr: "; pp.DataType
Debug.Print pp.DisplayString
Debug.Print "======================================"

End Sub

56
XRIO Automation

4.3.5 AutoParameterBoolean
Properties
ParameterValue { get, set }
Syntax: p.ParameterValue
Type: bool
Description: Gets or sets the value of the specified parameter.
ParameterReferenceValue { get, set }
Syntax: p.ParameterReferenceValue
Type: bool
Description: Gets or sets the reference value of the specified parameter.
Parameter { get }
Syntax: p.Parameter
Type: AutoParameter
Description: Gets a reference to the AutoParameter object associated with the parameter p.

4.3.6 AutoParameterString
Properties
ParameterValue { get, set }
Syntax: p.ParameterValue
Type: string
Description: Gets or sets the value of the specified parameter.
ParameterReferenceValue { get, set }
Syntax: p.ParameterReferenceValue
Type: string
Description: Gets or sets the reference value of the specified parameter.
Parameter { get }
Syntax: p.Parameter
Type: AutoParameter
Description: Gets a reference to the AutoParameter object associated with the parameter p.

57
OMICRON Test Universe

4.3.7 AutoParameterEnum
Properties
ParameterValue { get, set }
Syntax: p.ParameterValue
Type: string
Description: Gets or sets the value of the specified parameter.
ParameterReferenceValue { get, set }
Syntax: p.ParameterReferenceValue
Type: string
Description: Gets or sets the reference value of the specified parameter.
EnumValues { get }
Syntax: p.EnumValues
Type: AutoEnumValues
Description: Gets the collection of associated enumeration values.
Parameter { get }
Syntax: p.Parameter
Type: AutoParameter
Description: Gets a reference to the AutoParameter object associated with the parameter p.

58
XRIO Automation

4.4 Other Objects

4.4.1 AutoEnumValue
Enumeration values are a keyvalue pair, where the key is the Id and the value is the name. The id is
used as internal value. The name may be localized, and is used as display value shown to the user.
The XRIO editor uses a combo box to select one of the defined values.

Properties
ParentElementNode { get }
Syntax: enumValue.ParentElementNode
Type: AutoParameter
Description: Gets the parameter node to which the specified enumeration value belongs.
Id { get, set }
Syntax: enumValue.Id
Type: string
Description: Gets or sets the Id of an enumeration value.
Name { get, set }
Syntax: enumValue.Name
Type: string
Description: Gets or sets the name of an enumeration value.
InternalName { get, set }
Syntax: enumValue.InternalName
Type: string
Description: Gets or sets the internal name of an enumeration value.
DisplayName { get, set }
Syntax: enumValue.DisplayName
Type: string
Description: Gets or sets the display name of an enumeration value.

59
OMICRON Test Universe

Methods
IsValidId
Syntax: enumValue.IsValidId(string Id)
Return Type: bool
Description: Determines whether an Id is valid.
IsValidName
Syntax: enumValue.IsValidName(string name)
Return Type: bool
Description: Determines whether the name is a valid name.

60
XRIO Automation

4.4.2 AutoFormulaReference
Formulas are valid expressions in the script language VB.NET. Numerical constants, identifiers,
functions and operators are the elements of a formula.

Example: VN*SQRT(3)

VN is a formula reference to any parameter in the XRIO document. The name VN is independent from
the parameters id and must only be unique inside the formula.
There are two types of formula references. A formula reference can refer to a parameter or to an
enumeration value. The result of the formula is calculated with the current internal value of the
referenced parameter or enumeration value. The internal value of an enumeration value is the Id.

Properties
Type { get }
Syntax: formulaReference.Type
Type: ReferenceType.Parameter | ReferenceType.EnumValue
Description: Gets the type of a formula reference.
Parameter { get }
Syntax: formulaReference.Parameter
Type: AutoParameter
Description: Gets an object reference to the referenced parameter object.
EnumValue{ get }
Syntax: formulaReference.
Type: AutoEnumValue
Description: Gets an object reference to the referenced enumeration value object.

61
OMICRON Test Universe

4.4.3 AutoIec61850
This optional object allows the definition of same attributes related to the IEC61850 standard. An
Iec61850 Object can be added to blocks and parameters to define some IEC related information. This
information is currently not used from the Test Universe itself, but can be used from any kind of SW
that uses the available automation interfaces.
Access to the Iec61850 object is given through the block and parameter property Iec61850.

Properties
ObjectName {get, set }
Syntax: iec.ObjectName
Type: string
Description: Gets or sets the IEC61850 Object Name.
Syntax: iec.ObjectName
Hierarchy { get, set }
Syntax: iec.Hierarchy
Type: string
Description: Gets or sets the IEC61850 Hierarchy. Following the IEC61850 standard, this
attribute must be:
Undefined | SERVER | LD | LN | DATA | DA | DACC | DACP
DataTypeCategory { get, set }
Syntax: iec.DataTypeCategory
Type: string
Description: Gets or sets the IEC61850 DataTypeCategory. Following the IEC61850
standard, this attribute must be:
CtrlBlock | LNClass | CDClass | DAClass | BasicType
DataType { get, set }
Syntax: iec.DataType
Type: string
Description: Gets or sets the DataType.
Table of DataType values defined in the standard:
If DataTypeCategory is "CtrlBlock":
Undefined
BRCB GoCB GsCB LCB MSVCB
URCB USVCB SGCB

62
XRIO Automation

If DataTypeCategory is "LNClass":
Undefined
ANCR ARCO ATCC AVCO CALH
CCGR CILO CPOW CSWI GAPC
GGIO GSAL IARC IHMI ITCI
ITMI LLN0 LN LPHD MDIF
MHAI MHAN MMTR MMXN MMXU
MSQI MSTA PDIF PDIR PDIS
PDOP PDUP PFRC PHAR PHIZ
PIOC PMRI PMSS POPF PPAM
PSCH PSDE PTEF PTOC PTOF
PTOV PTRC PTTR PTUC PTUF
PTUV PUPF PVOC PVPH PZSU
RADR RBDR RBRF RDIR RDRE
RDRS RFLO RPSB RREC RSYN
SARC SIMG SIML SPDC TCTR
TVTR XCBR XSWI YEFN YLTC
YPSH YPTR ZAXN ZBAT ZBSH
ZCAB ZCAP ZCON ZGEN ZGIL
ZLIN ZMOT ZREA ZRRC ZSAR
ZTCF ZTCR
If DataTypeCategory is "CDClass":
Undefined
ACD ACT APC ASG BCR
BSC CMV CSD CURVE DPL
DEL DPC DPS HDEL HMV
HWYE INC INC8 ING INS
ISC LPL MV SAV SEC
SEQ SPC SPG SPS WYE
If DataTypeCategory is "DAClass":
Undefined
AnalogValue ScaledValueConfig RangeConfig ValWithTrans PulseConfig
Originator Unit Vector Point
If DataTypeCategory is "BasicType":
Undefined
BOOLEAN
INT8 INT16 INT24 INT32 INT128
INT8U INT16U INT24U INT32U
FLOAT32" FLOAT64
ENUMERATED CODED_ENUM
OCTET_STRING VISIBLE_STRING UNICODE_STRING

63
OMICRON Test Universe

Constraint { get, set }


Syntax: iec.Constraint
Type: string
Description: Gets or sets the IEC61850 functional constraint.
The standard defines the following functional constraints:
Undefined
BR CO CF DC EX
GO GS LG MS MX
RP SE SG SP ST
SV US

Example:
Public Sub IecDemo(block As AutoBlock)

Dim blocks As AutoBlocks


Dim newBlock As AutoBlock
Dim pBool As AutoParameterBoolean
Dim p As AutoParameter
Dim iecSection As AutoIec61850

On Error GoTo ErrorHandler

Set blocks = block.blocks


Set newBlock = blocks.Add("BNEW")
' Set block properties for the new custom block
newBlock.Description = "New block description"
newBlock.Id = "BNEW"
newBlock.Name = "B1 Name"
newBlock.ForeignId = "ForeignIdForBlock"
newBlock.UserComment = "User comment for Block"
newBlock.Enabled = True
' add an iec section to the block
Set iecSection = newBlock.Iec61850
iecSection.ObjectName = "IecObjectName"
iecSection.Hierarchy = "LN"
iecSection.DataType = "Undefined"

' add and modify a boolean parameter


Set parameters = newBlock.parameters
Set p = parameters.Add(ParamDataType_Real, "PNEW")
Dim errorText As String
p.Description = "Description for new parameter"
If p.SetDisplayValue("12.5", errorText) = False Then
Debug.Print errorText
End If

64
XRIO Automation

p.Enabled = False
' add an iec section to the parameter
Set iecSection = p.Iec61850
iecSection.ObjectName = "IecObjectName"
iecSection.Hierarchy = "DACP"
iecSection.DataTypeCategory = "BasicType"
iecSection.DataType = "FLOAT64"
iecSection.Constraint = "BR"

Exit Sub

ErrorHandler:
Debug.Print "Err.Number = "; Err.Number
Debug.Print "Err.Source = "; Err.Source
Debug.Print "Err.Description = "; Err.Description
Err.Clear
Resume Next

End Sub

65
OMICRON Test Universe

4.5 Collections

4.5.1 AutoBlocks
Is a collection to manage the child blocks inside a block. Add, insert and remove blocks, retrieve
blocks by its index, its object reference or by its ID.

Properties
Count { get }
Syntax: blocks.Count
Type: int
Description: Gets the number of blocks contained in the blocks collection.
Indexer
Syntax: blocks[index as Integer]
Type: AutoBlock
Description: Gets the block at the specified index. The value index has to be in the range 1
blocks.Count.
Item
Syntax: blocks.Item[index as Integer]
Type: AutoBlock
Description: Gets the block at the specified index.

Methods
Clear
Syntax: blocks.Clear()
Return Type: void
Description: Removes all blocks (parameters and child blocks of these blocks) from the
collection.
Contains
Syntax: blocks.Contains(AutoBlock block)
Return Type: bool
Description: Determines whether the specified block object is in the collection.
ContainsId
Syntax: blocks.ContainsId(string id)
Return Type: bool
Description: Determines whether the block collection contains a block with the specific id.

66
XRIO Automation

ItemId
Syntax: blocks.ItemId(string id)
Return Type: AutoBlock
Description: Gets the block with the specified id. The return value is a null reference
(Nothing in VB) if the id is not found.
IndexOf
Syntax: blocks.IndexOf (AutoBlock block)
Return Type: int
Description: Returns the index of the specified block in the collection.
Add
Syntax: blocks.Add(string id)
Return Type: AutoBlock
Description: Adds a block with the specified id to the end of the block collection. If the id
exists, then the id will be automatically changed by adding a consecutive
number at the end of the id.
Example:
Dim xRio As OMXRio.xRio
Dim doc As OMXRioData.AutoDocument
Dim block As OMXRioData.AutoBlock
Dim myBlock As OMXRioData.AutoBlock
Dim i As Integer

...

Set block = doc.CustomBlock

block.Blocks.Clear
Set myBlock = block.Blocks.Add("PARAMETERS")
myBlock.Name = "Parameters"
Set myBlock = block.Blocks.Add("EARTHFAULT")
Set myBlock = block.Blocks.Add("AUTORECLOSE")

Debug.Print "List of Blocks"


For i = 1 To block.Blocks.Count
Debug.Print i, block.Blocks(i).ID, block.Blocks(i).Name
Next i
Insert
Syntax: blocks.Insert(int index, string id)
Return Type: AutoBlock
Description: Inserts a new block with the specified id at position index.

67
OMICRON Test Universe

Remove
Syntax: blocks.Remove(AutoBlock block)
Return Type: void
Description: Removes the specified block from the collection. This command removes also
all child blocks and parameters contained in the block.
RemoveAt
Syntax: blocks. RemoveAt (int index)
Return Type: void
Description: Removes the block at the specified index.
GetEnumerator
Syntax: blocks.GetEnumerator()
Return Type: IEnumerator
Description: Returns an enumerator that can iterate through the collection.

68
XRIO Automation

4.5.2 AutoParameters
A collection to manage the parameters inside a block. Add, insert and remove parameters, retrieve
parameters by its index, its object reference or by its ID.

Properties
Indexer
Syntax: parameters [int index]
Type: AutoParameter
Description: Gets the parameter at the specified index.
Count { get }
Syntax: parameters.Count
Type: int
Description: Gets the number of parameters contained in the parameter collection.
Item { get }
Syntax: parameters.Item[int index]
Type: AutoParameter
Description: Gets the parameter at the specified index.

Methods
Clear
Syntax: parameters.Clear()
Return Type: void
Description: Removes all parameters from the collection.
Contains
Syntax: parameters.Contains (AutoParameter p)
Return Type: bool
Description: Determines whether the specified parameter object is in the collection.
ItemId
Syntax: parameters.ItemId (string id)
Return Type: AutoParameter
Description: Gets the parameter with the specified id. The return value is a null reference
(Nothing in VB) if the id is not found.
IndexOf
Syntax: IndexOf (AutoParameter p)
Return Type: int
Description: Returns the index of the specified parameter in the collection.

69
OMICRON Test Universe

Add
Syntax: parameters.Add (ParamDataType type, string id)
Return Type: AutoParameter
Description: Adds a new parameter with the specified id to the end of the parameter
collection. If the id exists, then it will be automatically changed by adding a
consecutive number at its end.
Insert
Syntax: parameters.Insert (int index, ParamDataType type, string id)
Return Type: AutoParameter
Description: Inserts a new parameter with the specified id at position index.
Remove
Syntax: parameters.Remove (AutoParameter param)
Return Type: void
Description: Removes the parameter at the specified index.
RemoveAt
Syntax: parameters.RemoveAt (int index)
Return Type: void
Description: Removes the parameter with the specified index.
GetEnumerator
Syntax: parameters.GetEnumerator
Return Type: IEnumerator
Description: Returns an enumerator that can iterate through the collection.
Example
n = block.Parameters.Count
For i = 1 To n
Set p = block.Parameters.Item(i)
Call ProcessParameter(p)
Next i

70
XRIO Automation

4.5.3 AutoEnumValues
Properties and Indexer
Indexer
Syntax: enumValues [int index]
Type: AutoEnumValue
Description: Gets the enumeration value at the specified index.
Count { get }
Syntax: enumValues.Count
Type: int
Description: Gets the number of enumeration values (Id-Name pair) contained in the list of
actually defined enumeration values.
Item { get }
Syntax: enumValues.Item[int index]
Type: AutoEnumValue
Description: Gets the enumeration value at the specified index.

Methods
Clear
Syntax: enumValues.Clear()
Return Type: void
Description: Removes all values from the collection.
Contains
Syntax: enumValues.Contains (AutoEnumValue enumValue)
Return Type: bool
Description: Determines whether the specified enumeration value object is in the collection.
ItemId
Syntax: enumValues.ItemId(string id)
Return Type: AutoEnumValue
Description: Gets the enumeration object with the specified id. The return value is a null
reference (Nothing in VB) if the id is not found.
IndexOf
Syntax: enumValues.IndexOf (object item)
Return Type: int
Description: Returns the index of the specified enumeration value in the collection.

71
OMICRON Test Universe

Add
Syntax: enumValues.Add (string id, string name)
Return Type: AutoEnumValue
Description: Adds a new enumeration item with the specified id and name pair to the
collection of enumeration items.
Insert
Syntax: enumValues.Insert (int index, string id, string name)
Return Type: AutoEnumValue
Description: Inserts a new enumeration item with the specified id and name pair at the
specified index into the collection of enumeration items.
RemoveAt
Syntax: enumValues.RemoveAt (int index)
Return Type: void
Description: Removes the enumeration value at the specified index.
GetEnumerator
Syntax: enumValues.GetEnumerator()
Return Type: IEnumerator
Description: Returns an enumerator that can iterate through the collection.

Example:

Set pEnum = p.ParameterEnum


pEnum.EnumValues.Clear
Call pEnum.EnumValues.Add("F50", "50 Hz")
Call pEnum.EnumValues.Add("F60", "60 Hz")
pEnum.ParameterValue = "F60"

72
XRIO Automation

4.5.4 AutoFormulaReferences
Properties
Indexer
Syntax: formulaReferences [int index]
Type: AutoFormulaReference
Description: Gets the formula reference at the specified index.
Count { get }
Syntax: formulaReferences.Count
Type: int
Description: Gets the number of formula references used in the value formula.
Item { get }
Syntax: formulaReferences.Item[int index]
Type: AutoFormulaReference
Description: Gets the formula reference at the specified index.

Methods
Clear
Syntax: formulaReferences.Clear()
Return Type: void
Description: Removes all formula references from the collection.
Contains
Syntax: formulaReferences.Contains(AutoFormulaReferenence fref)
Return Type: bool
Description: Determines whether the specified formula reference object is in the collection.
IndexOf
Syntax: formulaReferences.IndexOf (AutoFormulaReference fref)
Return Type: int
Description: Returns the index of the specified formula reference.
AddParam
Syntax: formulaReferences.AddParam (string id, string path, AutoParameter param)
Return Type: AutoFormulaReference
Description: Adds a new reference to a parameter the list of formula references. Id is the
name used in the formula, path is the unique id path of the parameter, param is
a reference to the parameter.

73
OMICRON Test Universe

AddEnumValue
Syntax: formulaReferences.AddEnumValue (string id, string path, AutoEnumValue
enumValue)
Return Type: AutoFormulaReference
Description: Adds a new reference to an enumeration value to the list of formula references.
Id is the name used in the formula, path is the unique id path of the parameter,
param is a reference to the parameter.
RemoveAt
Syntax: formulaReferences.RemoveAt (int index)
Return Type: void
Description: Removes the formula reference at the specified index.
GetEnumerator
Syntax: formulaReferences.GetEnumerator()
Return Type: IEnumerator
Description: Returns an enumerator that can iterate through the collection.

Example
Sub AddFormula(p As AutoParameter, _
p1 As AutoParameter, p2 As AutoParameter)

Dim path1 As String


Dim path2 As String
path1 = doc.GetIDsPathFromParam(p1)
path2 = doc.GetIDsPathFromParam(p2)

Call p.ValueReferences.AddParam("P1", path1, p1)


Call p.ValueReferences.AddParam("P2", path2, p2)
p.ValueFormula = "P1*P2"

End Sub

74
XRIO Automation

4.5.5 AutoCustomDataValues
Properties and Indexer
Indexer
Syntax: customDataValues [index]
Type: string
Description: Gets the data value with the specified index.
Count { get }
Syntax: customDataValues.Count
Type: int
Description: Gets the number of key-value pairs contained in the collection of custom
defined values.
Item { get }
Syntax: customDataValues.Item[int index]
Type; string
Description: Gets the data value with the specified index.

Methods
Clear
Syntax: customDataValues.Clear()
Return Type: void
Description: Removes all custom data values.
ItemId
Syntax: customDataValues.ItemId (string id)
Return Type: string
Description: Returns the data value associated with the specified key (Id).

75
OMICRON Test Universe

GetKey
Syntax: customDataValues.GetKey(int index)
Return Type: string
Description: Gets the key of the key-value pair at the specified index.
Example (VBA):
Sub ShowCustomDataValues(block As OMXRioData.AutoBlock, row As
Integer)
Dim customDataValues As OMXRioData.AutoCustomDataValues
Dim i As Integer
Dim n As Integer

Set customDataValues = block.customDataValues


n = customDataValues.Count

' Fill cells on a worksheet with the custom data values

Workbooks(1).Activate
Cells(row, 1).Value2 = "Key"
Cells(row, 2).Value2 = "Item"
For i = 1 To n
Cells(row + i, 1).Value2 = customDataValues.GetKey(i)
Cells(row + i, 2).Value2 = customDataValues.Item(i)
Next i

End Sub
Add
Syntax: customDataValues. Add(string key, string value)
Return Type: bool
Description: Adds a new key-value pair of custom data values to the end of the custom data
values collection.
Example (VBA):
Set customBlock = doc.customBlock
Set block = customBlock.Blocks.Add("SYNCHRO")
success = block.customDataValues.Add("SYNCCHECK", "Yes")
success = block.customDataValues.Add("DUMIN", "2%")
success = block.customDataValues.Add("DUMAX", "2%")
RemoveAt
Syntax: customDataValues.RemoveAt (string key)
Return Type: void
Description: Removes the custom data value with the specified key from the collection.

76
XRIO Automation

4.6 Errors
Errors detected during de-serialization or within the scope of modifying the document with the XRIO
editor are collected in an error list. The user interface optionally shows the errors in a list view at the
bottom of the editor window. Automation enables full control over this error list. An automation client
has access to the collection of errors; the client can read the registered errors, can delete errors and
can add new errors to the collection of errors.

4.6.1 AutoErrorList
Properties
Indexer
Syntax: errorList [int index]
Type: AutoError
Description: Gets the error at the specified index.
Item
Syntax: errorList.Item[int index]
Type: AutoError
Description: Gets the error at the specified index.
Count { get; }
Syntax: errorList.Count
Type: int
Description: Gets the number of errors contained in the error list.
HasScriptErrors { get }
Syntax: errorList.HasScriptErrors
Type: bool
Description: Gets a value indicating whether the script has errors.

Methods
Clear
Syntax: errorList.Clear()
Return Type: void
Description: Removes all errors in the error list.
ClearGroup
Syntax: errorList.ClearGroup (ErrorGroup group)
Return Type: void
Description: Removes all errors with the specified group.

77
OMICRON Test Universe

ClearForNode
Syntax: errorList.ClearForNode (ErrorGroup group, string elementNodePath)
Return Type: void
Description: Removes all errors with the specified group and the specified id path.
ClearAllScriptErrors
Syntax: errorList.ClearAllScriptErrors()
Return Type: void
Description: Removes all script errors.
AddError
Syntax: errorList.AddError (ErrorType type, ErrorGroup group, string number,
int line, int column, string idPath, string userPath, string description)
Return Type: void
Description: Adds an error with the specified properties to the list of errors.
AddErrorEx
Syntax: errorList.AddErrorEx (ErrorType type, ErrorGroup group, string number,
int line, int column, string idPath, string userPath, string description, string
comment)
Return Type: void
Description: Adds an error with the specified properties to the list of errors. The difference to
AddError is the additional argument comment.
HasEnabledFormulaScriptErrors
Syntax: errorList.HasEnabledFormulaScriptErrors (string elementNodePath)
Return Type: bool
Description: Gets a value indicating whether the block or parameter with the specified path
has errors in the formula for the enabled flag.
HasValueFormulaScriptErrors
Syntax: errorList.HasValueFormulaScriptErrors (string parameterPath)
Return Type: bool
Description: Gets a value indicating whether the parameter with the specified path has errors
in the value formula.

78
XRIO Automation

4.6.2 AutoError
Properties
Column { get }
Syntax: error.Column
Type: int
Description: For XML-Validation errors and for VB.NET compiler errors this is the number of
the column where the error was detected.
Comment { get }
Syntax: error.Comment
Type: string
Description: Gets the comment for the specified error. This field is not used from the
software. You can use this field inside your scripting code. To specify a
comment use the method AddErrorEx from the AutoErrorList object.
Description { get }
Syntax: error.Description
Type: string
Description: Gets a description of the error, this is the error text.
Group { get }
Syntax: error.Group
Type: ErrorGroup
Description: Gets the error group to which the error belongs. Errors are classified in different
error groups. See ErrorGroup constants.
GroupText { get }
Syntax: error.GroupText
Type: string
Description: Gets a text describing the error group.
Line { get }
Syntax: error.Line
Type: int
Description: For XML-Validation errors and for VB.NET compiler errors this is the number of
the line with the detected error.
IdPath { get }
Syntax: error.IdPath
Type: string
Description: Gets the Id-path of the block or parameter with an error.

79
OMICRON Test Universe

IsScriptError { get }
Syntax: error.IsScriptError
Type: bool
Description: Returns true, if the error is a compiler error generated during compiling the VB
script code.
Number { get }
Syntax: error.Number
Type: string
Description: Gets the error number.
Type { get }
Syntax: error.Type
Type: ErrorType
Description: Gets the type of the error.
TypeText { get }
Syntax: error.TypeText
Type: string
Description: Gets a text describing the error type.
UserPath { get }
Syntax: error.UserPath
Type: string
Description: Whenever possible, the software stores the path to a block or parameter with an
error in the error entry. This property gets the path in form of the name
concatenation.

80
XRIO Automation

Methods
IsEnabledFormulaScriptError
Syntax: error. IsEnabledFormulaScriptError(string elementNodePath)
Return Type: bool
Description: Returns true, if the error is an error in the formula for the enabled flag of the
specified block or parameter.
IsValueFormulaScriptError
Syntax: error.IsValueFormulaScriptError(string parameterPath)
Return Type: bool
Description: Returns true, if the error is an error in the value formula of the specified
parameter.

Example:

Sub ShowErrors(doc As AutoDocument)

Dim errorList As AutoErrorList


Dim error As AutoError
Dim i As Integer

Sheets("Errors").Activate
Rows("2:100").Select
Selection.ClearContents
Rows("2:100").ClearContents
range("A2").Select

Set errorList = doc.Errors


For i = 0 To errorList.Count - 1
Set error = errorList.Item(i)
Cells(i + 2, 1).Value = error.TypeText
Cells(i + 2, 2).Value = error.GroupText
Cells(i + 2, 3).Value = error.idPath
Cells(i + 2, 4).Value = error.UserPath
Cells(i + 2, 5).Value = error.Description
If (error.Group = ErrorGroup_DataType) Then
Dim p As AutoParameter
Set p = doc.GetParamFromIDs(error.idPath)
Cells(i + 2, 6).Value = p.DisplayString
End If
Next i

End Sub

81
OMICRON Test Universe

4.7 Access Control

4.7.1 Introduction
The XRIO editor implements two operation modes to adapt the user interface to two different kinds of
users. The terms "normal" and "advanced" specify these modes. The idea behind these modes is
that a "tester" uses the normal mode and a "designer" uses the advanced mode. The terms tester
and designer are used as synonyms for normal and advanced mode.
Depending from the mode, menu items, toolbar buttons and all other controls are visible or not visible,
enabled or not enabled to allow or not allow changing values, formulas, add or delete blocks and
parameters. These "rights" are implemented as an access matrix.
An automation client can use the AccessControl object to modify the access matrix and configure the
XRIO editor and grant or deny rights to modify the XRIO document for these two modes.
Although the concept allows configuring UI and rights for both modes, we recommend to leave the
default settings for the advanced mode unchanged and to configure only the normal mode.
A basic XRIO concept is that the RIO part has a strongly defined structure of blocks and parameters
and that the custom part is very flexible. To protect the structure of the RIO part, an operation is only
allowed, if the necessary right is assigned and the RIO grammar allows the operation. Inside RIO only
some collections, e.g. line and arcs in a generic shape or points in a characteristic table can be
changed.

Default settings for user interface:

Commands / View Advanced (Designer) Normal (Tester)


AddRioFunction
CanChangeRole
CanUseImport
CanUseExport
CanUseImportFilter
CanUseExportFilter X
CanUseOrganizer X
CustomizeTableColumns X
ViewDisabledNodes X
ViewBlockCommands X
ViewParameterCommands X
ViewRioTree
ViewRioBlocks X
CanUseDisplayFilter X
CanCopyReferenceValueToValue X
CanCopyValueToReferenceValue X

82
XRIO Automation

83
OMICRON Test Universe
Default settings for the rights, depending from the context and the user mode.
Context Custom RIO Blocks RIO Parameters
Right Designer Tester Designer Tester Designer Tester
AddBlock X X n/a n/a
AddParameter X X n/a n/a
ChangeBlockCollection X X n/a n/a
ChangeParameterCollection X X X X
Delete X X X X
ChangeType X X X X
ChangeIds X X X X
ChangeNames X X X X
ChangeForeignId X X X X
ChangeComment X X X X
ChangeEnabled X X X X
ChangeEnabledFormula X X X X
ChangeValue n/a n/a X
ChangeValueFormula X n/a n/a X
ChangeReferenceValue X n/a n/a n/a n/a

84
XRIO Automation

4.7.2 AutoAccessControl
Properties
IsDocumentReadOnly { get }
Syntax: accessControl.IsDocumentReadOnly
Type: bool
Description: Returns true, if the document is in a read only state, e.g. after an executed test.
Role { get, set }
Syntax: accessControl.Role
Type: Role
Description: Gets or sets the role for the current user.
Example:
accessControl.Role = Role_Designer
or
accessControl.Role = Role_Tester

Methods
GetAccess
Syntax: accessControl.GetAccess ( Role role, Context context, Rights right)
Return Type: bool
Description: Returns true if the specified right for the specified context is assigned to the
specified role, otherwise the return value is false.
Example: The example writes all rights that a user have in the designer mode to
manipulate blocks in the RIO part into a file.
Print #1
Print #1, "Rights for Context = RioBlock"
Print #1, "------------------------------------------------------"
For myRight = Rights_AddBlock To Rights_ChangeValueFormula
rightName = accessControl.GetRightName(myRight)
fillString = Space$(27-Len(rightName))
p = accessControl.GetAccess(Role_Designer, Context_RioBlock,
myRight)
Print #1, rightName; fillString; p; Chr$(9);
p = accessControl.GetAccess(Role_Tester, Context_RioBlock, myRight)
Print #1, p
Next myRight
Print #1, "------------------------------------------------------"

85
OMICRON Test Universe

SetAccess
Syntax: accessControl.SetAccess ( Role role, Context context, Rights right, bool permit)
Return Type: void
Description: Sets a new value to permit or deny a right for the specified context and the
specified role.
Example:
accessControl.SetAccess(Role_Tester, _
Context_RioParameter, Rights_ChangeValue, False)
GetUIProperty
Syntax: accessControl.GetUIProperty ( Role role, UIProperties uiProperty)
Return Type: bool
Description: Returns true if the specified property is enabled for the specified role otherwise
the result is false.
Example:
Dim t as Role, d as Role
t = Role_Tester
d = Role_Designer
pd = accessControl.GetUIProperty(d,
UIProperties_ViewParameterCommands)
pt = accessControl.GetUIProperty(t,
UIProperties_ViewParameterCommands)
Print #1, "ViewParameterCommands "; pd; Chr(9); pt
pd = accessControl.GetUIProperty(d, UIProperties_ViewRioTree)
pt = accessControl.GetUIProperty(t, UIProperties_ViewRioTree)
Print #1, "ViewRioTree "; pd; Chr(9); pt
SetUIProperty
Syntax: accessControl.SetUIProperty ( Role role, UIProperties uiProperty, bool permit)
Return Type: void
Description: Set a new value to enable or disable a user interface command or to show or
hide user interface controls.
Example:
accessControl.SetUIProperty(Role_Designer,
UIProperties_ViewParameterCommands)
accessControl.SetUIProperty(t, UIProperties_ViewParameterCommands)

IsTableColumnVisible
Syntax: accessControl.IsTableColumnVisible ( Role role, ColumnName colName )
Return Type: bool
Description: Returns true if the specified column is visible in the specified user mode,
otherwise false.

86
XRIO Automation

SetShowTableColumn
Syntax: accessControl.SetShowTableColumn ( Role role, ColumnName colName, bool
newValue
Return Type: void
Description: Use this method to define whether the specified column in the specified user
mode is visible or hidden.
Example:
accessControl.SetShowTableColumn( _
Role_Tester, ColumnName_ForeignId, False)
accessControl.SetShowTableColumn( _
Role_Tester, ColumnName_Description, False)
SetDefaultValues
Syntax: accessControl.SetDefaultValues()
Return Type: void
Description: Resets all rights and user interface settings to the default values.
GetRightName
Syntax: accessControl.GetRightName ( Rights right )
Return Type: string
Description: Gets a string containing the name of the specified right.
Example:
Dim t as Role
t = Role_Tester
For myRight = Rights_AddBlock To Rights_ChangeValueFormula
rightName = accessControl.GetRightName(myRight)
p = accessControl.GetAccess(t, Context_RioParameter, myRight)
Debug.Print rightName; p
Next myRight
GetUIPropertyName
Syntax: accessControl.GetUIPropertyName ( UIProperties uiProperty )
Return Type: string
Description: Gets a string containing the name of the specified user interface setting.

87
OMICRON Test Universe

4.8 Filter Objects


XRIO uses an extendable concept of updating data from/to external sources/targets: the XRIO filters.
Filters are pluggable pieces of software that can extend the ways data is exchanged with XRIO. In the
user interface a filter import can be processed using the "File / Import relay settings" command in
the XRIO editor.

This functionality (and additionally exporting) is also accessible via Automation.

4.8.1 AutoFilters
This collection hosts all the XRIO Filters that are installed on the current system.

Properties and Indexer


Indexer
Syntax: filters [int index]
Type: AutoFilter
Description: Gets the filter object at the specified index.
Item
Syntax: filters.Item[int index]
Type: AutoFilter
Description: Gets the filter object at the specified index.
Count { get }
Syntax: filters.Count
Type: int
Description: Gets the number of XRIO filters (Id-Name pair) contained in the list.

Methods
ItemId
Syntax: filters.ItemId(string id)
Return Type: AutoFilter
Description: Gets the filter object with the specified id. The return value is a null reference
(Nothing in VB) if the id is not found.
ExecuteImport
Syntax: filters. ExecuteImport(AutoFilter selectedFilter, bool withUI)
Return Type: bool
Description: Performs an import using the selectedFilter.

88
XRIO Automation

GetEnumerator
Syntax: filters.GetEnumerator()
Return Type: IEnumerator
Description: Returns an enumerator that can iterate through the collection.

4.8.2 AutoFilter
Properties
AssemblyPath { get }
Syntax: filter.AssemblyPath
Type: string
Description: Gets the path of the current assembly executable file.
Id { get }
Syntax: filter.Id
Type: string
Description: Gets the ID of the current filter object.
IsExportSupported { get }
Syntax: filters.IsExportSupported
Type: bool
Description: Returns true if the current filter also supports export.
Name { get }
Syntax: filter.Name
Type: string
Description: Returns the name of the current filter.
Version { get }
Syntax: filter.Version
Type: double
Description: Gets version information of the filter.
VersionString
Syntax: filter.VersionString
Type: String
Description: Gets version information of the filter as a string.

89
OMICRON Test Universe

Methods
ExecuteExport
Syntax: filter. ExecuteExport
Return Type: bool
Description: Performs an export using the current filter.
ExecuteImport
Syntax: filter. ExecuteImport
Return Type: bool
Description: Performs an import using the current filter.
GetParameter
Syntax: filter.GetParameter(bool isImport, string paramName)
Return Type: string
Description: Gets the parameters of the current filter.
SetParameter
Syntax: filter.GetParameter(bool isImport, string paramName, string paramValue)
Return Type: void
Description: Sets the parameters of the current filter.
ShowParameterDialog
Syntax: filter.ShowParameterDialog(bool isImport)
Return Type: bool
Description: Shows the parameter dialog (that has to be implemented in the filter).

Example: Execute a filter export using an automation script

Dim xrioapp As OMXRio.XRio


Dim xriofilter As OMXRioFilter.AutoFilter

Set xrioapp = Document.TestObjects(1).Specific


Set xriofilter = xrioapp.XRioFilters.ItemId("XMLStandardFilter")
xriofilter.SetParameter(False, "FilePath", "d:\FilterExport.xml")
xriofilter.ExecuteExport

Set xrioapp = Nothing


Set xriofilter = Nothing

90
XRIO Automation

4.9 Dependency Objects


The formula and reference definition that is part parameter, block and formula reference objects
describe the structures between a defined formula and its referenced parameters.

To fulfill its tasks XRIO has to model the other direction, too. Is a parameter, a block or parts of a sub
block tree referenced by other formulas?

4.9.1 AutoDependency
Methods
HasBlockDependencies
Syntax: dependency.HasBlockDependencies(AutoBlock b)
Return Type: bool
Description: Checks if the current block (or one of its sub blocks, parameters or enumeration
values) contains formula definitions or that it is used by formulas that are
defined outside the block (see IsBlockUsed function).

HasEnumValueDependencies
Syntax: dependency.HasEnumValueDependencies(EnumValue e)
Return Type: bool
Description: Checks if the current enumeration value definition (this is one of the possible
values of an enumeration parameter) contains formula definitions or that it is
used by formulas that are defined outside (see IsEnumValueUsed function).

HasParameterDependencies
Syntax: dependency.HasParameterDependencies(AutoBlock b)
Return Type: bool
Description: Checks if the current parameter (or one of its enumeration values) contains
formula definitions or that it is used by formulas that are defined outside the
block (see IsParameterUsed function).

IsBlockUsed
Syntax: dependency.IsBlockUsed(AutoBlock b)
Return Type: bool
Description: Checks if the current block (or one of its sub blocks, parameters or enumeration
values) is used by formulas that are defined outside the block.

91
OMICRON Test Universe

IsEnumValueUsed
Syntax: dependency.IsEnumValueUsed(EnumValue e)
Return Type: bool
Description: Checks if the current enumeration value definition (this is one of the possible
values of an enumeration parameter) is used by formulas that are defined
outside.

IsParameterUsed
Syntax: dependency.IsParameterUsed(AutoBlock b)
Return Type: bool
Description: Checks if the current parameter (or one of its enumeration values) is used by
formulas that are defined outside the block.

Example:

Set dep = xrioApp.XRioDependency


Set block = xrioApp.XRioDocument.CustomBlock.Blocks(1)

If dep.HasBlockDependencies(block) Then
MsgBox "BlockDependencies"
End If

If dep.IsBlockUsed(block) Then
MsgBox "IsBlockUsed"
End If

Set enumParam = xrioApp.XRioDocument.CustomBlock.Blocks(1). _


Parameters(2)
If dep.IsParameterUsed(enumParam) Then
MsgBox "IsParamUsed"
End If

Set enumDef = enumParam.ParameterEnum.EnumValues(2)


If dep.IsEnumValueUsed(enumDef) Then
MsgBox "IsEnumUsed"
End If

Set dep = Nothing


Set block = Nothing
Set enumParam = Nothing
Set enumDef = Nothing

92
XRIO Automation

4.10 Enumerations and Constants

4.10.1 DocState
This enumeration is the return type of the document methods LoadFromFile and LoadFromString.
Member name Description
FatalError Signals that the operation fails. In this case normally the XML
document is not well formed.
Warnings Signals that the document could be read, but that the XML-document
contains errors (invalid parameter values, validation errors).
NoError The document has no errors.

4.10.2 ErrorGroup
XRIO distinguishes different errors and classifies an error according to the source and the severity of
an error. ErrorGroup enumerates the different errors.

Member name Description


XRioSchema XML schema error.
Versioning Error reported from the versioning code.
DataType Data type for a RIO parameter is wrong.
DataValue The parameter value is not valid according to its data type or is
outside the limits.
UniqueId A collection contains items with the same ID.
FormulaDependency Formula references refer directly or indirectly to the formulas result,
creating a circular reference.
Script Unspecified error in the script code, for example during the calculation
phase.
GlobalScript An error, detected from the script compiler in the global script (user-
defined procedures) section.
ValueFormula Formula for the parameter value has an error.
EnabledFormula Formula for the enabled flag of a block or parameter has an error.
FormulaReferences A formula reference refers to a nonexistent parameter or enumeration
value.
Filter An error occurred during the execution of an import or export filter.
Common All other unspecified errors.

93
OMICRON Test Universe

4.10.3 ErrorType
ErrorType classifies the severity of an error, the members are Error, Warning and Information.

4.10.4 NodeType
Specifies the different node types.
Applies to: Distance test object.
NodeType members:

Member name Description


Root The (XML) root node of an XRIO document
CustomRoot Root node (block) of custom part, is child of Root.
Rio Root node (block) of RIO part, is child of Root.
Script Node with scripting functions as content.
Custom Block in the custom part.
Parameter Parameter in the custom part.
RioGenerator Contains information about the RIO converter (generator).

Members for all kinds of
blocks in the RIO part.

4.10.5 ParamDataType
Specifies the different parameter data types.
ParamDataType members:
Member name .NET Type / Description
Boolean bool
Enumeration List of ID and possible localized name pairs. The actual internal value
is one of the unique ID's.
Integer Int32; Range: -2,147,483,648 to 2,147,483,647
Real Double, Range: 5.0 10324 to 1.7 10308; Precision: 15-16
digits
String Unicode character string.

94
XRIO Automation

4.10.6 ParamUnitType
Specifies the different unit types for parameters.
Applies to: Parameters with floating point data (ParamDataType_Real)
ParamUnitType members:

Member name .NET Type / Description


Direct No conversation between internal value and display value.
Cycles Internal value is a time in seconds.
Kelvin Internal value is a temperature in C.
Fahrenheit Internal value is a temperature in C.

4.10.7 ReferenceType
Specifies to different types of formula references.
Applies to: Formulas
ReferenceType members:

Member name .NET Type / Description


Parameter The formula reference refers to a parameter.
EnumValue The formula reference refers to an enumeration value.

4.10.8 Context
The content of an XRIO document must fulfill formal rules defined by a XML schema and test object
specific rules. The blocks and parameters in the RIO part are predefined from OMICRON, the content
of the custom part is defined from a relay manufacturer, a test developer or from the end user. The
software uses the access control component to show or hide, enables and disables menus and
commands to manipulate the content of an XRIO document. Which kind of data manipulations are
allowed for a specific node depends from the node type and the user's role. The context classifies the
different nodes into three groups.
Member name Description
RioBlock A block in the strongly defined RIO part.
RioParameter A parameter in the strongly defined RIO part.
Custom Block or parameter in the custom part.

95
OMICRON Test Universe

4.10.9 Rights
Specifies rights to manipulate a XRIO document. Whether a right is enabled or disabled depends from
the role and the context. Applies to: Access control component
Rights members:
Member name Description
AddBlock Add new blocks to a blocks collection.
AddParameter Add new parameter to a parameter collection
ChangeBlockCollection Change the order of blocks in a blocks collection.
ChangeParameterCollection Change the order of parameters in a parameters collection.
Delete Delete a node.
ChangedEnabled Change the enabled flag of a block or parameter.
ChangeEnabledFormula Change the formula for the enabled flag.
ChangeIds Change the ID of blocks, parameters or enumeration values.
ChangeNames Change the name of blocks, parameters or enumeration values.
ChangeType Change the type of a parameter.
ChangeValue Change the parameter value.
ChangeValueFormula Change the formula for the parameter value.
ChangeForeignId Change the foreign identifier.
ChangeComment Change the comment (block or parameter).
AddCustomData Can add a custom data collection.
AddIecData Can add a IEC block.
ChangeReferenceValue Change the parameter reference value
Coun Number of enumeration members. (17)

4.10.10 Role
Specifies two different types of roles for the user.
Applies to: Access control
Role members:

Member name Description


Designer Intended for a user, who will develop RIO converters and/or
extensions to the XRIO document.
Tester Intended for a user, who will use a prepared XRIO document to
examine a well defined standalone test or the test in a prepared OCC
document.

96
XRIO Automation

4.10.11 UIProperties
Specifies restrictions for the XRIO editor user interface. Applies to: Access control
UIProperties members:
Member name Description
AddRioFunction The right to add RIO functions.
CanChangeRole The right to change the role from designer to tester and vice
versa.
CanUseExport The right to export (store) a RIO document in a XRIO-file.
CanUseExportFilter The right to use export filters.
CanUseImport The right to import (read) a XRIO document.
CanUseImportFilter The right to use export filters.
CanUseOrganizer The right to use the organizer. The organizer can merge XRIO
files.
CustomizeTableColumns The right to customize the table columns (hides and show
columns).
ViewBlockCommands Determines whether the menu and toolbar buttons for the block
commands are visible.
ViewDisabledNodes Determines whether disabled nodes are visible.
ViewParameterCommands Determines whether the menu and toolbar buttons for the
parameter commands are visible.
ViewRioBlocks Determines whether child blocks of RIO functions are visible, in
other words determines whether the RIO functions can be
expanded.
ViewRioTree Determines whether the RIO node is visible.
CanUseDisplayFilter The right to use display filters.
CanCopyReferenceValueToValue The right to copy the reference value onto the value
CanCopyValueToReferenceValue The right to copy the value onto the reference value
Count Number of enumeration members ( = 16)

97
OMICRON Test Universe

4.10.12 ColumnName
This enumeration enumerates the columns in the parameter table.
The AccessControl object allows you to configure the parameter table for two different user modes.
Use this enumeration to address a column. The value conforms to the column number. Count is the
maximal number of columns.
Member name Column number / Comment
Not defined (Status Icon) 0
Name 1
Id 2
ForeignId 3
Description 4
ReferenceValue 5
Value 6
Unit 7
Min 8
Max 9
Formula 10
Count Number of columns = 11

4.10.13 CallerType
For internal use.

4.10.14 OvcCharType
Enumerates the different types of Overcurrent characteristics.
Applies to: Overcurrent test object.
Member name Description
I2T A characteristic t(IT) based on the I2T equation.
IAC A characteristic t(IT) based on the IAC equation.
Inverse A characteristic t(IT) based on the IEEE standard equation.
Predefined To choose one of four predefinded characteristics.
UserDefined The characteristic is defined through a list of points (t, IT).

98
XRIO Automation

4.10.15 GroundingFactor
Specifies methods to define the grounding factor. For further information, refer to the XRIO manual.
Applies to: Distance test object.

Member name Description


KL Defines the complex grounding factor directly as magnitude and
phase.
ZNR_ZNX Defines the grounding factor with the values RE/RL and XE/XL.
Z0Z1 Defines the grounding factor in the form Z0 / Z1

4.10.16 Tolerance
Specifies different modes of setting tolerances.
Applies to: Distance test object.

Member name Description


TTOLMINUS Tolerance for tripping times used as t - t.
TTOLPLUS Tolerance for tripping times used as t + t.
TTOLREL Tolerance for tripping times in relative values.
ZTOLABS Tolerance for Impedance in absolute values.
ZTOLREL Tolerance for Impedance in relative values.

99
OMICRON Test Universe

4.10.17 TransducerFunctionType
Specifies different transducer functions.
Applies to: Transducer test object.

Member name Description


TransducerFuncActivePower Active Power P ( U I cos )
TransducerFuncReactivePower Reactive Power Q ( U I sin )
TransducerFuncApparentPower ApparentPower S ( U I )
TransducerFuncFrequency Frequency
TransducerFuncCurrent Current
TransducerFuncVoltage Voltage
TransducerFuncPowerFactor Power factor cos
TransducerFuncLF LF [(1-p/S)*sgn Q]
TransducerFuncPhaseII Phase [I-I]
TransducerFuncPhaseVI Phase [V-I]
TransducerFuncPhaseVV Phase [V-V]
TransducerFuncISigAvg Signed Average I
TransducerFuncDCCurrent DC Current
TransducerFuncDCVoltage DC Voltage
TransducerFuncDCPower DC Power
TransducerFuncLLVoltage L-L Voltage
TransducerFuncFirst first member in this enumeration
TransducerFuncLast last member in this enumeration

4.10.18 TransducerOuputType
Specifies the transducer output.
Applies to: Transducer test object.
Member name Description
TransducerOutputCurrent Current
TransducerOutputVoltage Voltage
TransducerOutputOpenLoop Open Loop

100
XRIO Automation

5 Appendix
Abbreviations
RIO Relay Interface by OMICRON
XRIO eXtended Relay Interface by OMICRON
XML eXtensible Markup Language
XPath String used to address parts of an XML file
VBA Visual Basic for Applications
VB.Net Visual Basic.Net

Definitions
Test Object Component of the Test Universe software describing the device under test
XRIO Specification for Test Object definitions introduced with Test Universe 2.0
XRIO File Saved XRIO Test Object as a file
XRIO Converter Test Object with automatic calculation of parameters from settings
XRIO Filter Software to import/export data in/from an XRIO Converter
Automation Microsoft technology that enables cross-application programming.
Automation Client Application that controls/programs other application using Automation, e.g. a
scripting environment

References and Additional Manuals

[1] : "XRIO User Manual"


[2] : "XRIO Automation Manual"
[3] : "XRIO Reference Manual"
[4] : "XRIO Filter Manual"

101
OMICRON Test Universe

Support

When you are working with our products we want to provide you with the
greatest possible benefits. If you need any support, we are here to assist you!

24/7 Technical Support Get Support


www.omicron.at/support
www.omicronusa.com/support

Offering our customers outstanding support is one of our top priorities. At our
technical support hotline, you can reach well-educated technicians for all of your
questions. Around the clock competent and free of charge.

Make use of our 24/7 international technical support hotline: +43 59495 4444.

Additionally, you can find our Service Center or Sales Partner closest to you at
www.omicron.at or www.omicronusa.com.

Customer Area Stay Informed


www.omicron.at/customer
www.omicronusa.com/customer

The customer area on our website is an international knowledge exchange


platform. Download the latest software updates for all products and share your
own experiences in our user forum.

Browse through the knowledge library and find application notes, conference
papers, articles about daily working experiences, user manuals and much more.

OMICRON Academy Learn More


www.omicron.at/academy
www.omicronusa.com/academy

Learn more about your product in one of the training courses offered by the
OMICRON Academy.

OMICRON electronics GmbH, Oberes Ried 1, 6833 Klaus, Austria, +43 59495

102