a b/project/sparkplug™_mqtt_edge_and_host-stack_b9741afd/function_blocks_8ad6e219/fb_sparkplugbxcoderhandler_c978db11/fb_sparkplugbxcoderhandler_b276ae31/b276ae31a54c4d6f8b78cab400d0ac12.object
1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)b276ae31-a54c-4d6f-8b78-cab400d0ac12","ParentGuid":"(Guid)00000000-0000-0000-0000-000000000000","Name":"(string)FB_SparkplugBxCoderHandler","Properties":{"@Type":"2c41fa04:IDictionary","@Value":[{"@Key":"(Guid)24568a24-c491-472c-a21f-ee5d33859fab","@Value":{"@Type":"24568a24","@Value":{"MemoryReserveForOnlineChange":"(int)0","ExcludeFromBuild":"(bool)False","External":"(bool)False","EnableSystemCall":"(bool)False","CompilerDefines":"(string)","LinkAlways":"(bool)False","Undefines":{"@Type":"[string]","@Value":[]}}}},{"@Key":"(Guid)829a18f2-c514-4f6e-9634-1df173429203","@Value":{"@Type":"829a18f2","@Value":{"ParentObjects":{"@Type":"fa2ee218:IDictionary","@Value":[{"@Key":"(Guid)21af5390-2942-461a-bf89-951aaf6999f1","@Value":"(Guid)c978db11-2d73-4525-b89e-1dd43367678a"}]}}}}]},"TypeGuid":"(Guid)6f9dac99-8de1-4efc-8465-68ac443b7d08","EmbeddedTypeGuids":{"@Type":"[Guid]","@Value":["(Guid)a9ed5b7e-75c5-4651-af16-d2c27e98cb94","(Guid)3b83b776-fb25-43b8-99f2-3c507c9143fc"]}}},"TypeInfos":{"24568a24":"{24568a24-c491-472c-a21f-ee5d33859fab}","2c41fa04":"{2c41fa04-1834-41c1-816e-303c7aa2c05b}","81297157":"{81297157-7ec9-45ce-845e-84cab2b88ade}","829a18f2":"{829a18f2-c514-4f6e-9634-1df173429203}","bool":"System.Boolean","fa2ee218":"{fa2ee218-a39b-4b6d-b249-49dbddbd168a}","Guid":"System.Guid","int":"System.Int32","string":"System.String"}},"object":{"Graph":{"@Type":"6f9dac99","@Value":{"SpecialFunc":{"@Type":"0db3d7bb:Enum","@Value":"None"},"Implementation":{"@Type":"3b83b776","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)2414","Tag":null,"Text":"(string)_Encoder(xEncode:= _Encode, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2415","Tag":null,"Text":"(string)\tprotobufBlobSize:= _EncodedBlobSize, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2416","Tag":null,"Text":"(string)\tmyProtobufBlob:= _EncodedBlob, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2417","Tag":null,"Text":"(string)\txEncodeDone=> _EncodeDone, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2418","Tag":null,"Text":"(string)\txEncodeBusy=> _EncodeBusy, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2419","Tag":null,"Text":"(string)\txEncodeError=> _EncodeError, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2420","Tag":null,"Text":"(string)\teEncodeError=> _Encode_eError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2421","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2422","Tag":null,"Text":"(string)_Decoder(xDecode := _Decode,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2423","Tag":null,"Text":"(string)         protobufBlobSize := _DecodeBlobSize,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2424","Tag":null,"Text":"(string)         myProtobufBlob := _DecodeBlob,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2425","Tag":null,"Text":"(string)         xDecodeDone => _DecodeDone,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2426","Tag":null,"Text":"(string)         xDecodeBusy => _DecodeBusy,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2427","Tag":null,"Text":"(string)         xDecodeError => _DecodeError,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2428","Tag":null,"Text":"(string)         eDecodeError => _Decode_eError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2429","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1513","Tag":null,"Text":"(string)Diag();"}}]}}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)2431","Tag":null,"Text":"(string)(*"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2432","Tag":null,"Text":"(string)\tProvides SparkplugB Protobuf2   Encoding and Decoding of Messages or Protobufs"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2433","Tag":null,"Text":"(string)    "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2434","Tag":null,"Text":"(string)    According to wikipedia: "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2435","Tag":null,"Text":"(string)    Protocol Buffers is a method of serializing structured data."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2436","Tag":null,"Text":"(string)    It is useful in developing programs to communicate with each other over a network or for storing data."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2437","Tag":null,"Text":"(string)    "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2438","Tag":null,"Text":"(string)    Protobuf Encoding / Decoding is fast and provides a \"compression ratio\" of circa 2:1 in good to 3:1 in optimum conditions."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2439","Tag":null,"Text":"(string)    It achieves this (by design) via \"varint encoding\" - a variable-length encoding for integer data that means small values use less space."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2440","Tag":null,"Text":"(string)    Note that protobuf2 does not compress the data in a traditional sense via a zip/gzip type of encoding, which is not described in the spec"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2441","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2442","Tag":null,"Text":"(string)    Estimates, no guarantees whatsover are implied;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2443","Tag":null,"Text":"(string)        • Encoding => 1000 units could become 333 units after encoding, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2444","Tag":null,"Text":"(string)          but a score of 2:1 (= 500 units after encoding) is considered good."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2445","Tag":null,"Text":"(string)        • Decoding => 333 encoded units could become 1000 decoded units optimally, "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2446","Tag":null,"Text":"(string)          but a score of 2:1 (= 666 units after decoding) is considered good."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2447","Tag":null,"Text":"(string)    "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2448","Tag":null,"Text":"(string)    Source : https://cdn2.hubspot.net/hubfs/2335443/Johnathan-Hottell-IIoT-Protocol-Benchmarks.pdf"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2449","Tag":null,"Text":"(string)    P48 states : "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2450","Tag":null,"Text":"(string)        Final Takeaways "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2451","Tag":null,"Text":"(string)        • The most bandwidth savings comes from report by exception."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2452","Tag":null,"Text":"(string)        • Sparkplug compresses 3x."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2453","Tag":null,"Text":"(string)        • Trading Modbus for MQTT Sparkplug on exception can result in ~75% to ~99.5% network bandwithsavings "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2454","Tag":null,"Text":"(string)          but it will depend on your application, number of points, criticality of the data, and other factors(!)            "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2455","Tag":null,"Text":"(string)        • Network bandwidth savings is always an estimate until you actually implement and test in the real world..."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2456","Tag":null,"Text":"(string)   "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2457","Tag":null,"Text":"(string)*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2458","Tag":null,"Text":"(string){attribute 'hide'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2459","Tag":null,"Text":"(string){attribute 'no_assign'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2460","Tag":null,"Text":"(string)FUNCTION_BLOCK FB_SparkplugBxCoderHandler"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2461","Tag":null,"Text":"(string)VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2462","Tag":null,"Text":"(string)    _Encoder : FB_Payload;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2463","Tag":null,"Text":"(string)    _EncodedBlob : ARRAY[0..MQTT.MQTTParam.g_udiMaxPayloadSize] OF BYTE; // Protobuf serilized blob, Max Blob Size of 64 KByte "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2464","Tag":null,"Text":"(string)    _EncodedBlobSize : DINT; // Size of the blob after a succesful encoding"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2465","Tag":null,"Text":"(string)    _NextSeqNum : ULINT := 0; //next sequence number (0..255)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2466","Tag":null,"Text":"(string)    _NextBdSeq : ULINT := 0; //next birth/death sequence number (0..255)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2467","Tag":null,"Text":"(string)    _EncodeDiag : STRING;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2468","Tag":null,"Text":"(string)    _DecodeDiag : STRING;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2469","Tag":null,"Text":"(string)    _TimeStamp : T_DateTime;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2470","Tag":null,"Text":"(string)    _Encode : BOOL := FALSE; // Start Encoding if Enable = TRUE, Stops encoding if enable = FALSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2471","Tag":null,"Text":"(string)    _EncodeDone : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2472","Tag":null,"Text":"(string)    _EncodeBusy : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2473","Tag":null,"Text":"(string)    _EncodeError : BOOL; // Based on CBML.LCon, but will automatically be reset if xEncode"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2474","Tag":null,"Text":"(string)    _Encode_eError : ERROR; // Enumerated Encoding Error    "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2475","Tag":null,"Text":"(string)    _Decoder : FB_Payload;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2476","Tag":null,"Text":"(string)    _Decode : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2477","Tag":null,"Text":"(string)    _DecodeBlobSize : DINT; // Size of the blob after a succesful encoding "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2478","Tag":null,"Text":"(string)    _DecodeBlob : ARRAY[0..MQTT.MQTTParam.g_udiMaxPayloadSize] OF BYTE; // Protobuf serilized blob, Max Blob Size of 64 KByte  "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2479","Tag":null,"Text":"(string)    _DecodeDone : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2480","Tag":null,"Text":"(string)    _DecodeBusy : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2481","Tag":null,"Text":"(string)    _DecodeError : BOOL; // Based on CBML.LCon, but will automatically be reset if xEncode"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)2482","Tag":null,"Text":"(string)    _Decode_eError : ERROR; // Enumerated Encoding Error                                     "}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1798","Tag":null,"Text":"(string)END_VAR"}}]}}}}},"UniqueIdGenerator":"(string)2482","POULevel":{"@Type":"8e575c5b:Enum","@Value":"Standard"},"ChildObjectGuids":{"@Type":"ArrayList:IList","@Value":[]},"AddAttributeSubsequent":"(bool)False"}},"TypeInfos":{"0db3d7bb":"{0db3d7bb-cde0-4416-9a7b-ce49a0124323}","3b83b776":"{3b83b776-fb25-43b8-99f2-3c507c9143fc}","6f9dac99":"{6f9dac99-8de1-4efc-8465-68ac443b7d08}","8e575c5b":"{8e575c5b-1d37-49c6-941b-5c0ec7874787}","a5de0b0b":"{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","ArrayList":"System.Collections.ArrayList","bool":"System.Boolean","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","long":"System.Int64","string":"System.String"}}},"FormatVersion":"1.0"}