--- a
+++ b/project/sparkplug™_mqtt_edge_and_host-stack_b9741afd/function_blocks_8ad6e219/fb_payload_ad205903/fb_payload_ddc74abf/encode_61dc3ecf/encodenextfloat_d8b25438/d8b254380de943e980922135a92150b3.object
@@ -0,0 +1 @@
+{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)d8b25438-0de9-43e9-8092-2135a92150b3","ParentGuid":"(Guid)ddc74abf-e7a4-407a-a4f5-0c8338e771b9","Name":"(string)EncodeNextFloat","Properties":{"@Type":"2c41fa04:IDictionary","@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)61dc3ecf-4aea-47a6-9ff3-993acbde812d"}]}}}}]},"TypeGuid":"(Guid)f8a58466-d7f6-439f-bbb8-d4600e41d099","EmbeddedTypeGuids":{"@Type":"[Guid]","@Value":["(Guid)a9ed5b7e-75c5-4651-af16-d2c27e98cb94","(Guid)3b83b776-fb25-43b8-99f2-3c507c9143fc"]}}},"TypeInfos":{"2c41fa04":"{2c41fa04-1834-41c1-816e-303c7aa2c05b}","81297157":"{81297157-7ec9-45ce-845e-84cab2b88ade}","829a18f2":"{829a18f2-c514-4f6e-9634-1df173429203}","fa2ee218":"{fa2ee218-a39b-4b6d-b249-49dbddbd168a}","Guid":"System.Guid","string":"System.String"}},"object":{"Graph":{"@Type":"f8a58466","@Value":{"Implementation":{"@Type":"3b83b776","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)617","Tag":null,"Text":"(string)//i will start pointing to the first byte of where to store the float"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)618","Tag":null,"Text":"(string)//TIP Protobuf floats (least significant byte will come first)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)619","Tag":null,"Text":"(string)IF ProtobufFieldNumber <> 0 THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)620","Tag":null,"Text":"(string)    // Encode the field number first"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)621","Tag":null,"Text":"(string)    IF ProtobufFieldNumber > 15 THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)622","Tag":null,"Text":"(string)        //If it is over 15, you gotta encode it as a varint"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)623","Tag":null,"Text":"(string)        dviTemp.UInt32 := SHL(TO_UDINT(ProtobufFieldNumber),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)624","Tag":null,"Text":"(string)            3) OR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)625","Tag":null,"Text":"(string)            TO_UDINT(FloatWireType);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)626","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)627","Tag":null,"Text":"(string)        EncodeNextFloat := EncodeNextVarInt(ValueToEncode := dviTemp,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)628","Tag":null,"Text":"(string)            ProtobufFieldNumber := 0);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)629","Tag":null,"Text":"(string)    ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)630","Tag":null,"Text":"(string)        IF _protobufBlobUpper < i THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)631","Tag":null,"Text":"(string)            //ERROR, there's not even enough room to write one byte!"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)632","Tag":null,"Text":"(string)            EncodeNextFloat := ERROR.PayloadNotEnoughProtobufBlob;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)633","Tag":null,"Text":"(string)        ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)634","Tag":null,"Text":"(string)            //OK, now you can encode it"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)635","Tag":null,"Text":"(string)            myProtobufBlob[i] := SHL(ProtobufFieldNumber,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)636","Tag":null,"Text":"(string)                3) OR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)637","Tag":null,"Text":"(string)                FloatWireType;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)638","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)639","Tag":null,"Text":"(string)            i := i + 1;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)640","Tag":null,"Text":"(string)        END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)641","Tag":null,"Text":"(string)    END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)642","Tag":null,"Text":"(string)END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)643","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)644","Tag":null,"Text":"(string)IF EncodeNextFloat = ERROR.NO_ERROR THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)645","Tag":null,"Text":"(string)    IF (SIZEOF(ValueToEncode) <= (_protobufBlobUpper - i + 1)) THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)646","Tag":null,"Text":"(string)        //ENCODE the Float.  First low byte... last high byte"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)647","Tag":null,"Text":"(string)        bytes := ADR(ValueToEncode);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)648","Tag":null,"Text":"(string)        {IF defined (IsLittleEndian)}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)649","Tag":null,"Text":"(string)        myProtobufBlob[i] := bytes[0];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)650","Tag":null,"Text":"(string)        myProtobufBlob[i + 1] := bytes[1];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)651","Tag":null,"Text":"(string)        myProtobufBlob[i + 2] := bytes[2];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)652","Tag":null,"Text":"(string)        myProtobufBlob[i + 3] := bytes[3];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)653","Tag":null,"Text":"(string)        {ELSE}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)654","Tag":null,"Text":"(string)        myProtobufBlob[i] := bytes[3];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)655","Tag":null,"Text":"(string)        myProtobufBlob[i + 1] := bytes[2];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)656","Tag":null,"Text":"(string)        myProtobufBlob[i + 2] := bytes[1];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)657","Tag":null,"Text":"(string)        myProtobufBlob[i + 3] := bytes[0];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)658","Tag":null,"Text":"(string)        {END_IF}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)659","Tag":null,"Text":"(string)        i := i + SIZEOF(ValueToEncode);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)660","Tag":null,"Text":"(string)    ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)661","Tag":null,"Text":"(string)        EncodeNextFloat := ERROR.PayloadNotEnoughProtobufBlob;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)662","Tag":null,"Text":"(string)    END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)663","Tag":null,"Text":"(string)END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)133","Tag":null,"Text":"(string)//i will end pointing to one after the last byte of the float (ie, an as yet unused address)"}}]}}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)599","Tag":null,"Text":"(string)(*"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)600","Tag":null,"Text":"(string)    This Writes a float a.k.a. REAL to the next available slot in the BLOB array"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)601","Tag":null,"Text":"(string)\tWill return ERROR.NO_ERROR (= 0) if successful"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)602","Tag":null,"Text":"(string)*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)603","Tag":null,"Text":"(string)METHOD EncodeNextFloat : ERROR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)604","Tag":null,"Text":"(string)//from the main FB"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)605","Tag":null,"Text":"(string)//i :DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)606","Tag":null,"Text":"(string)//myProtobufBlob : ARRAY OF BYTE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)607","Tag":null,"Text":"(string)//udiPayloadSize : UDINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)608","Tag":null,"Text":"(string)VAR_INPUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)609","Tag":null,"Text":"(string)    ValueToEncode : REAL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)610","Tag":null,"Text":"(string)    ProtobufFieldNumber : BYTE(0..15); //Set to 0 to not include. Highest Field Number not including extensions is 14, so we will do a little trick and not allow > 15, which would itself be a varint :S"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)611","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)612","Tag":null,"Text":"(string)VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)613","Tag":null,"Text":"(string)    bytes : POINTER TO BYTE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)614","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)615","Tag":null,"Text":"(string)VAR CONSTANT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)616","Tag":null,"Text":"(string)    FloatWireType : BYTE := 5;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)155","Tag":null,"Text":"(string)END_VAR"}}]}}}}}}},"TypeInfos":{"3b83b776":"{3b83b776-fb25-43b8-99f2-3c507c9143fc}","a5de0b0b":"{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","f8a58466":"{f8a58466-d7f6-439f-bbb8-d4600e41d099}","long":"System.Int64","string":"System.String"}}},"FormatVersion":"1.0"}
\ No newline at end of file