[r99]: / branches / i-campbell / mqttsparkplugb / mqttsparkplugb / SparkplugB / Function Blocks / FB_Payload_1 / FB_PayloadTemplate / svnobj  Maximize  Restore  History

Download this file

27 lines (26 with data), 7.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FUNCTION_BLOCK FB_PayloadTemplate
VAR_INPUT
	(*Trigers for conversion*)
	xDecode : BOOL;
	xEncode : BOOL;	
END_VAR
VAR_IN_OUT
	ProtobufBlobIndex : DINT;  //For decoding, starts where the start of the Object is, ends on the last byte of the Object.  For Encoding, starts where the first byte the Object should be written to, ends on the next free byte after this object
    myProtobufBlob : ARRAY [*] OF BYTE;//array of bytes containing the protobuf payload.  If the array is the whole
	myMetricsPool : ARRAY [*] OF FB_PayloadMetric;
	//myKeysPool : ARRAY [*] OF LinkedListWStringElement;
	//myDataSetColumnsPool : ARRAY[*] OF LinkedListWStringElement; //Maybe combine with KeysPool?
	//myDataSetTypesPool : ARRAY[*] OF FB_PayloadDataSetType;
	//myRowsPool         : ARRAY [*] OF FB_PayloadRow;
	//myElementsPool     : ARRAY [*] OF FB_PayloadElement;
	myParametersPool   : ARRAY [*] OF FB_PayloadParameter;
// Payload.metrics[].template_value.metrics[].   //(RECURSIVE Metrics)
    aMetrics      :COL.LinkedList;//of FB_PayloadMetric
// Payload.metrics[].template_value.parameters[].name
// Payload.metrics[].template_value.parameters[].type
// Payload.metrics[].template_value.parameters[].int_value
// Payload.metrics[].template_value.parameters[].long_value
// Payload.metrics[].template_value.parameters[].float_value
// Payload.metrics[].template_value.parameters[].double_value
// Payload.metrics[].template_value.parameters[].boolean_value
// Payload.metrics[].template_value.parameters[].string_value