NamespaceArray (FB)ΒΆ

FUNCTION_BLOCK PUBLIC ABSTRACT NamespaceArray IMPLEMENTS INamespaceArray, IOPCUAClientDataAccessCallback

Mapping table between application defined and the server defined namespace index .. note:

This kind of function block should be generated automatically by a configuration

Usage (Declaration):

{attribute 'no_explicit_call' := 'An explicit call makes no sense'}
{attribute 'no_assign'}
{attribute 'call_after_init'}
FUNCTION_BLOCK FINAL NamespaceArray EXTENDS UA.NamespaceArray
VAR
    // The application defined namespace index
    _aIndex : ARRAY[0..3] OF UA.NSIndex := [
        (*  0 *) (psNamespaceURI:=ADR('http://opcfoundation.org/UA/')),
        (*  1 *) (psNamespaceURI:=ADR('http://opcfoundation.org/UA/GDS/')),
        (*  2 *) (psNamespaceURI:=ADR('http://opcfoundation.org/UA/DI/')),
        (*  3 *) (psNamespaceURI:=ADR('http://opcfoundation.org/UA/IA/'))
    ];
END_VAR

Override the Init method of UA.NamespaceArray and set _pNSIndex and _udiIndexCount:

{attribute 'call_after_init'}
METHOD PROTECTED FINAL Init
    _pNSIndex := ADR(_aIndex);
    _udiIndexCount := SIZEOF(_aIndex) / SIZEOF(UA.NSIndex);
    SUPER^.Init();

Methods:

Structure: