ProtobufDecode

(Engine-Level Function)

Description: Decodes Protobuf serialized data.
Returns: VTScada data structures representing the message.
Usage: Script Only.
Function Groups: Protobuf
Related to: ProtobufInstantiate | ProtobufEncode | ProtobufParse
Format: ProtobufDecode(ProtobufHandle, MessageTypeName, EncodedString[, NoOptionalDefaulting])
Parameters:  
ProtobufHandle
Protobuf handle generated by ProtobufParse
MessageTypeName
Message type from ProtobufHandle's proto file
EncodedString
Protocol buffer to decode
NoOptionalDefaulting
Optional Boolean. Defaults to FALSE when unspecified or invalid. When TRUE, fields in a Protobuf message defined as optional and not present in the message are not given a default value when decoded.
Comments:

When decoding messages with optional fields (note that in Protobuf version 3 all fields are optional) the default value will be used if it is absent from the encoded message. An exception to this is fields defined within a oneof where no default values will be used.

 

Decoding and encoding of proto2 groups is not supported.

Example:

See: ProtobufInstantiate