[9a5d66]: / project / sparkplug™_mqtt_edge_and_host-stack_b9741afd / function_blocks_8ad6e219 / fb_payload_ad205903 / fb_payload_ddc74abf / decodenextstring_9056fe89 / 9056fe898491435a9e429c87e53964c4.object  Maximize  Restore  History

Download this file

1 lines (1 with data), 7.4 kB

1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)9056fe89-8491-435a-9e42-9c87e53964c4","ParentGuid":"(Guid)ddc74abf-e7a4-407a-a4f5-0c8338e771b9","Name":"(string)DecodeNextString","Properties":{"@Type":"2c41fa04:IDictionary","@Value":{}},"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}","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)434","Tag":null,"Text":"(string)//i will start pointing to the first byte of the varint representing the string length"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)435","Tag":null,"Text":"(string)//get the length"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)436","Tag":null,"Text":"(string)dviTemp := DecodeNextVarInt();"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)437","Tag":null,"Text":"(string)//i is now pointing to one byte before the first byte of the string"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)438","Tag":null,"Text":"(string)length := dviTemp.Int32;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)439","Tag":null,"Text":"(string)//to use this function, we're going to need a zero on the end"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)440","Tag":null,"Text":"(string)IF i + 1 + length < _protobufBlobUpper THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)441","Tag":null,"Text":"(string)    StoreTheByteTemporarily := myProtobufBlob[i + 1 + length]; //store the byte one after this string"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)442","Tag":null,"Text":"(string)    TerminateString( psIn := ADR( myProtobufBlob[i + 1] ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)443","Tag":null,"Text":"(string)                     udiLength := TO_UDINT( length ) ); //psIn[udiLength] := 0;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)444","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)445","Tag":null,"Text":"(string)    myCmpErrorsDotErrors := STU.ConvertUTF8toUTF16( sourceStart := ADR( myProtobufBlob[i + 1] ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)446","Tag":null,"Text":"(string)                                                    targetStart := ADR( DecodeNextString ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)447","Tag":null,"Text":"(string)                                                    dwTargetBufferSize := SIZEOF( DecodeNextString ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)448","Tag":null,"Text":"(string)                                                    bStrictConversion := FALSE );"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)449","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)450","Tag":null,"Text":"(string)    myProtobufBlob[i + 1 + length] := StoreTheByteTemporarily;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)451","Tag":null,"Text":"(string)ELSE                                              //WeOwnThePreviousByte"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)452","Tag":null,"Text":"(string)    StoreTheByteTemporarily := myProtobufBlob[i]; //store whatever the previous byte was"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)453","Tag":null,"Text":"(string)    FOR j := 0 TO length - 1 DO                   //SHIFT THE MEMORY UP ONE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)454","Tag":null,"Text":"(string)        myProtobufBlob[i + j] := myProtobufBlob[i + 1 + j];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)455","Tag":null,"Text":"(string)    END_FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)456","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)457","Tag":null,"Text":"(string)    TerminateString( psIn := ADR( myProtobufBlob[i] ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)458","Tag":null,"Text":"(string)                     udiLength := TO_UDINT( length ) ); //psIn[udiLength] := 0;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)459","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)460","Tag":null,"Text":"(string)    myCmpErrorsDotErrors := STU.ConvertUTF8toUTF16( sourceStart := ADR( myProtobufBlob[i] ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)461","Tag":null,"Text":"(string)                                                    targetStart := ADR( DecodeNextString ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)462","Tag":null,"Text":"(string)                                                    dwTargetBufferSize := SIZEOF( DecodeNextString ),"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)463","Tag":null,"Text":"(string)                                                    bStrictConversion := FALSE );"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)464","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)465","Tag":null,"Text":"(string)    FOR j := length - 1 TO 0 BY -1 DO //SHIFT THE MEMORY DOWN ONE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)466","Tag":null,"Text":"(string)        myProtobufBlob[i + 1 + j] := myProtobufBlob[i + j];"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)467","Tag":null,"Text":"(string)    END_FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)468","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)469","Tag":null,"Text":"(string)    //put the temporarily stored data back in its place"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)470","Tag":null,"Text":"(string)    myProtobufBlob[myProtobufBlob[i - 1]] := StoreTheByteTemporarily;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)471","Tag":null,"Text":"(string)END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)472","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)473","Tag":null,"Text":"(string)i := i + length;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)83","Tag":null,"Text":"(string)//returns with i pointing to the last byte of the ProtobufString"}}]}}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)428","Tag":null,"Text":"(string)METHOD DecodeNextString : WSTRING(GC_Sparkplug.supported_string_lengths)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)429","Tag":null,"Text":"(string)VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)430","Tag":null,"Text":"(string)    length                  : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)431","Tag":null,"Text":"(string)    myCmpErrorsDotErrors    : UDINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)432","Tag":null,"Text":"(string)    StoreTheByteTemporarily : BYTE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)433","Tag":null,"Text":"(string)    j                       : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)28","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"}