Value (FB)ΒΆ

FUNCTION_BLOCK PUBLIC Value

This function block represents a value inside a ValueSet.

Usage example:

_aValues : ARRAY[0..1] OF UA.Value := [
    (
        eType := UA.IEC_UDINT,
           pValue := ADR(udiValue),
           psNodeId := ADR('ns=4;s=path.udiValue')
    ),
    (
        eType := UA.IEC_STRING,
           pValue := ADR(sValue),
           udiSize := SIZEOF(sValue),
           psNodeId := ADR('ns=4;s=path.sValue')
    )
];
InOut:

Scope

Name

Type

Comment

Input

eType

IEC_TYPE

value type

pValue

POINTER TO BYTE

target location of the IEC value

If eType = IEC_ARRAY pValue is a pointer to ArrayValue
If eType = IEC_STRUCT pValue is a pointer to StructValue
If eType = IEC_UNION pValue is a pointer to UnionValue

udiSize

UDINT

(max) size of this item.
with the exception of the types [UWX]?STRING this value is calculated by the library.
If eType = IEC_ARRAY udiSize should be SIZEOF(UA.ArrayValue)
If eType = IEC_STRUCT udiSize should be SIZEOF(ARRAY[0..n] OF UA.StructValue)
If eType = IEC_UNION udiSize should be SIZEOF(UA.UnionValue)

psNodeId

POINTER TO NODEID

NodeId of the variable related to the servers address space

psEncodingId

POINTER TO NODEID

EncodingId of the variables type related to the servers address space
Only neccecary for top level descriptions of a STRUCT member

pTimestampValue

POINTER TO TimestampValue

IEC timestamp data target structure | Timestamp request is defined as global request for whole read operation via UA.Read.eTimestampsToReturn. | If timestamps are requested globally for all values of the ValueSet via UA.Read.eTimestampsToReturn, setting the pointer UA.Value.pTimestampValue is optional. | If no pointer is specified, the received timestamps are simply not decoded and no error is output.

Output

eError

ERROR

The error code of the last event;

Methods:

Structure: