Diff of /project/sparkplug™_mqtt_edge_and_host-stack_b9741afd/function_blocks_8ad6e219/fb_payload_ad205903/fb_payloadrow_08a73fc1/08a73fc17efa45b390a54a616421bbd5.object [2c693b] .. [3e6134]  Maximize  Restore

Switch to unified view

a/project/sparkplug™_mqtt_edge_and_host-stack_b9741afd/function_blocks_8ad6e219/fb_payload_ad205903/fb_payloadrow_08a73fc1/08a73fc17efa45b390a54a616421bbd5.object b/project/sparkplug™_mqtt_edge_and_host-stack_b9741afd/function_blocks_8ad6e219/fb_payload_ad205903/fb_payloadrow_08a73fc1/08a73fc17efa45b390a54a616421bbd5.object
1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)08a73fc1-7efa-45b3-90a5-4a616421bbd5","ParentGuid":"(Guid)00000000-0000-0000-0000-000000000000","Name":"(string)FB_PayloadRow","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)ad205903-8508-4926-9d55-99ed8855a066"}]}}}}]},"TypeGuid":"(Guid)6f9dac99-8de1-4efc-8465-68ac443b7d08","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":"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)1441","Tag":null,"Text":"(string)//This IF statement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1442","Tag":null,"Text":"(string)IF xDecode AND xEncode THEN //ERROR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1443","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1444","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1445","Tag":null,"Text":"(string)    xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1446","Tag":null,"Text":"(string)    eDecodeError := ERROR.PayloadYouCantDoBothAtOnce;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1447","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1448","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1449","Tag":null,"Text":"(string)    xEncodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1450","Tag":null,"Text":"(string)    eEncodeError := ERROR.PayloadYouCantDoBothAtOnce;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1451","Tag":null,"Text":"(string)ELSIF NOT xDecode AND NOT xEncode THEN //DO NOTHING, ALL OUTPUTS OFF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1452","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1453","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1454","Tag":null,"Text":"(string)    xDecodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1455","Tag":null,"Text":"(string)    eDecodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1456","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1457","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1458","Tag":null,"Text":"(string)    xEncodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1459","Tag":null,"Text":"(string)    eEncodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1460","Tag":null,"Text":"(string)ELSIF xDecode AND NOT xEncode THEN //Decode"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1461","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1462","Tag":null,"Text":"(string)    xDecodeBusy := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1463","Tag":null,"Text":"(string)    xDecodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1464","Tag":null,"Text":"(string)    eDecodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1465","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1466","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1467","Tag":null,"Text":"(string)    xEncodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1468","Tag":null,"Text":"(string)    eEncodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1469","Tag":null,"Text":"(string)ELSIF NOT xDecode AND xEncode THEN //Encode"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1470","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1471","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1472","Tag":null,"Text":"(string)    xDecodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1473","Tag":null,"Text":"(string)    eDecodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1474","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1475","Tag":null,"Text":"(string)    xEncodeBusy := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1476","Tag":null,"Text":"(string)    xEncodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1477","Tag":null,"Text":"(string)    eEncodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1478","Tag":null,"Text":"(string)END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1479","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1480","Tag":null,"Text":"(string)IF xDecodeBusy THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1481","Tag":null,"Text":"(string)    InitializeStructure();"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1482","Tag":null,"Text":"(string)    eDecodeState := PayloadDecodeStates.object_getlength;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1483","Tag":null,"Text":"(string)    //decode length"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1484","Tag":null,"Text":"(string)    dviTemp := OwnerPayload.DecodeNextVarInt(); //updates i to end of the varint"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1485","Tag":null,"Text":"(string)    lengthOfObject := dviTemp.int32;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1486","Tag":null,"Text":"(string)    finalByteIndex := ProtobufBlobIndex + lengthOfObject;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1487","Tag":null,"Text":"(string)    ProtobufBlobIndex := ProtobufBlobIndex + 1;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1488","Tag":null,"Text":"(string)    eDecodeState := PayloadDecodeStates.object_getmember;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1489","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1490","Tag":null,"Text":"(string)    //for i to i + length - 1"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1491","Tag":null,"Text":"(string)    FOR ProtobufBlobIndex := ProtobufBlobIndex TO finalByteIndex DO"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1492","Tag":null,"Text":"(string)        CASE eDecodeState OF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1493","Tag":null,"Text":"(string)            PayloadDecodeStates.object_getmember:"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1494","Tag":null,"Text":"(string)                CASE myProtobufBlob[ProtobufBlobIndex] OF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1495","Tag":null,"Text":"(string)                    16#00: //end of data? padding byte? ERROR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1496","Tag":null,"Text":"(string)                        xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1497","Tag":null,"Text":"(string)                        eDecodeError := ERROR.PayloadFound00;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1498","Tag":null,"Text":"(string)                        ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1499","Tag":null,"Text":"(string)                    ProtobufedId.Row_elements:"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1500","Tag":null,"Text":"(string)                        eDecodeState := PayloadDecodeStates.object_getelement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1501","Tag":null,"Text":"(string)                ELSE //extension... error"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1502","Tag":null,"Text":"(string)                    xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1503","Tag":null,"Text":"(string)                    eDecodeError := ERROR.PayloadFoundExtensions;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1504","Tag":null,"Text":"(string)                    ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1505","Tag":null,"Text":"(string)                END_CASE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1506","Tag":null,"Text":"(string)            PayloadDecodeStates.object_getelement:"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1507","Tag":null,"Text":"(string)                //So i imagine, a metric should be able to decode itself, in one go"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1508","Tag":null,"Text":"(string)                recentlyClaimedElement REF= AddElementBlank(OwnerPayload := OwnerPayload,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1509","Tag":null,"Text":"(string)                    eError => eDecodeError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1510","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1511","Tag":null,"Text":"(string)                IF eDecodeError = ERROR.NO_ERROR THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1512","Tag":null,"Text":"(string)                    //i starts off now pointing to the first byte of the Metric"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1513","Tag":null,"Text":"(string)                    THIS^.recentlyClaimedElement(xDecode := TRUE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1514","Tag":null,"Text":"(string)                        xEncode := FALSE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1515","Tag":null,"Text":"(string)                        protobufBlobMaxIndex := protobufBlobMaxIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1516","Tag":null,"Text":"(string)                        OwnerPayload := OwnerPayload,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1517","Tag":null,"Text":"(string)                        ProtobufBlobIndex := ProtobufBlobIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1518","Tag":null,"Text":"(string)                        myProtobufBlob := myProtobufBlob,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1519","Tag":null,"Text":"(string)                        xDecodeDone =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1520","Tag":null,"Text":"(string)                        xDecodeBusy =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1521","Tag":null,"Text":"(string)                        xDecodeError => xDecodeError,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1522","Tag":null,"Text":"(string)                        eDecodeError => eDecodeError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1523","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1524","Tag":null,"Text":"(string)                    IF recentlyClaimedElement.xDecodeDone THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1525","Tag":null,"Text":"(string)                        //SUCCESS! the latest object has now been decoded"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1526","Tag":null,"Text":"(string)                        //i is now pointing to the very last byte of the object"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1527","Tag":null,"Text":"(string)                        eDecodeState := PayloadDecodeStates.object_getmember;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1528","Tag":null,"Text":"(string)                    ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1529","Tag":null,"Text":"(string)                        ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1530","Tag":null,"Text":"(string)                    END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1531","Tag":null,"Text":"(string)                ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1532","Tag":null,"Text":"(string)                    xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1533","Tag":null,"Text":"(string)                    //eDecodeError := ERROR.Can't Claim Metric;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1534","Tag":null,"Text":"(string)                    ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1535","Tag":null,"Text":"(string)                END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1536","Tag":null,"Text":"(string)        END_CASE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1537","Tag":null,"Text":"(string)    END_FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1538","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1539","Tag":null,"Text":"(string)    IF NOT xDecodeError THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1540","Tag":null,"Text":"(string)        ProtobufBlobIndex := ProtobufBlobIndex - 1; //i is now final byte index.\t"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1541","Tag":null,"Text":"(string)    END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1542","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1543","Tag":null,"Text":"(string)    eDecodeState := PayloadDecodeStates.idle;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1544","Tag":null,"Text":"(string)    xDecodeDone := NOT xDecodeError;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1545","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1546","Tag":null,"Text":"(string)END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1547","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1548","Tag":null,"Text":"(string)IF xEncodeBusy THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1549","Tag":null,"Text":"(string)    //NOTE: BLOB Data will not be initialized to 00."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1550","Tag":null,"Text":"(string)    //But we will start with a 0 byte payload."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1551","Tag":null,"Text":"(string)    //store the starting byte, because we need it right at the end"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1552","Tag":null,"Text":"(string)    startingByteOfEncodedData := ProtobufBlobIndex;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1553","Tag":null,"Text":"(string)    //Encode All Elements"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1554","Tag":null,"Text":"(string)    _elements.ItterateRestart(HasNext => _COL_HasNext);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1555","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1556","Tag":null,"Text":"(string)    WHILE _COL_HasNext AND (eEncodeError = ERROR.NO_ERROR) DO"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1557","Tag":null,"Text":"(string)        _elements.ItterateNext(itfElement => _COL_Element,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1558","Tag":null,"Text":"(string)            HasNext => _COL_HasNext);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1559","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1560","Tag":null,"Text":"(string)        IF __QUERYPOINTER(_COL_Element,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1561","Tag":null,"Text":"(string)            nextELementToEncode) THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1562","Tag":null,"Text":"(string)            nextELementToEncode^(xDecode := FALSE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1563","Tag":null,"Text":"(string)                xEncode := TRUE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1564","Tag":null,"Text":"(string)                protobufBlobMaxIndex := protobufBlobMaxIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1565","Tag":null,"Text":"(string)                OwnerPayload := OwnerPayload,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1566","Tag":null,"Text":"(string)                ProtobufBlobIndex := ProtobufBlobIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1567","Tag":null,"Text":"(string)                myProtobufBlob := myProtobufBlob,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1568","Tag":null,"Text":"(string)                xDecodeDone =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1569","Tag":null,"Text":"(string)                xDecodeBusy =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1570","Tag":null,"Text":"(string)                xDecodeError =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1571","Tag":null,"Text":"(string)                eDecodeError =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1572","Tag":null,"Text":"(string)                xEncodeDone =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1573","Tag":null,"Text":"(string)                xEncodeBusy =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1574","Tag":null,"Text":"(string)                xEncodeError => xEncodeError,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1575","Tag":null,"Text":"(string)                eEncodeError => eEncodeError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1576","Tag":null,"Text":"(string)        END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1577","Tag":null,"Text":"(string)    END_WHILE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1578","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1579","Tag":null,"Text":"(string)    //Field number and length and we're done!"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1580","Tag":null,"Text":"(string)    IF eEncodeError = ERROR.NO_ERROR THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1581","Tag":null,"Text":"(string)        //{info 'todo: i-campbell Make these field numbers a GVL'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1582","Tag":null,"Text":"(string)        eEncodeError := OwnerPayload.ReencodeLengthDelimited(ProtobufFieldNumber := 4,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1583","Tag":null,"Text":"(string)            startingByteOfEncodedData := startingByteOfEncodedData);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1584","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1585","Tag":null,"Text":"(string)        xEncodeError := eEncodeError <> ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1586","Tag":null,"Text":"(string)    END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1587","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1588","Tag":null,"Text":"(string)    //DONE :)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1589","Tag":null,"Text":"(string)    xEncodeDone := NOT xEncodeError;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1590","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)9","Tag":null,"Text":"(string)END_IF;"}}]}}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)1404","Tag":null,"Text":"(string){attribute 'hide'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1405","Tag":null,"Text":"(string)FUNCTION_BLOCK FB_PayloadRow IMPLEMENTS LinkedList.IElement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1406","Tag":null,"Text":"(string)VAR_INPUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1407","Tag":null,"Text":"(string)    (*Trigers for conversion*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1408","Tag":null,"Text":"(string)    xDecode : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1409","Tag":null,"Text":"(string)    xEncode : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1410","Tag":null,"Text":"(string)    protobufBlobMaxIndex : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1411","Tag":null,"Text":"(string)    PoolManager : IPoolManager;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1412","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1413","Tag":null,"Text":"(string)VAR_IN_OUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1414","Tag":null,"Text":"(string)    OwnerPayload : FB_Payload; //He manages the assigning of Pool Objects"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1415","Tag":null,"Text":"(string)    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"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1416","Tag":null,"Text":"(string)    myProtobufBlob : ARRAY[*] OF BYTE; //array of bytes containing the protobuf payload.  If the array is the whole"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1417","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1418","Tag":null,"Text":"(string)VAR_OUTPUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1419","Tag":null,"Text":"(string)    xDecodeDone, xDecodeBusy, xDecodeError : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1420","Tag":null,"Text":"(string)    eDecodeError : ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1421","Tag":null,"Text":"(string)    xEncodeDone, xEncodeBusy, xEncodeError : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1422","Tag":null,"Text":"(string)    eEncodeError : ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1423","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1424","Tag":null,"Text":"(string)VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1425","Tag":null,"Text":"(string)    (*Internal variables*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1426","Tag":null,"Text":"(string)    dviTemp : DecodedVarInt;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1427","Tag":null,"Text":"(string)    startingByteOfEncodedData : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1428","Tag":null,"Text":"(string)    eDecodeState : PayloadDecodeStates;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1429","Tag":null,"Text":"(string)    lengthOfObject : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1430","Tag":null,"Text":"(string)    finalByteIndex : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1431","Tag":null,"Text":"(string)    recentlyClaimedElement : REFERENCE TO FB_PayloadElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1432","Tag":null,"Text":"(string)    nextELementToEncode : POINTER TO FB_PayloadElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1433","Tag":null,"Text":"(string)    _elements : LinkedList.List; // Of FB_PayloadElement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1434","Tag":null,"Text":"(string)    _COL_HasNext : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1435","Tag":null,"Text":"(string)    _COL_Element : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1436","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1437","Tag":null,"Text":"(string)    // LinkedList.IElement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1438","Tag":null,"Text":"(string)    _itfPrev : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1439","Tag":null,"Text":"(string)    _itfNext : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1440","Tag":null,"Text":"(string)    _itfList : LinkedList.IList;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1","Tag":null,"Text":"(string)END_VAR"}}]}}}}},"UniqueIdGenerator":"(string)1590","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"}
1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)08a73fc1-7efa-45b3-90a5-4a616421bbd5","ParentGuid":"(Guid)00000000-0000-0000-0000-000000000000","Name":"(string)FB_PayloadRow","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)ad205903-8508-4926-9d55-99ed8855a066"}]}}}}]},"TypeGuid":"(Guid)6f9dac99-8de1-4efc-8465-68ac443b7d08","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":"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)1441","Tag":null,"Text":"(string)//This IF statement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1442","Tag":null,"Text":"(string)IF xDecode AND xEncode THEN //ERROR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1443","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1444","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1445","Tag":null,"Text":"(string)    xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1446","Tag":null,"Text":"(string)    eDecodeError := ERROR.PayloadYouCantDoBothAtOnce;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1447","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1448","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1449","Tag":null,"Text":"(string)    xEncodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1450","Tag":null,"Text":"(string)    eEncodeError := ERROR.PayloadYouCantDoBothAtOnce;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1451","Tag":null,"Text":"(string)ELSIF NOT xDecode AND NOT xEncode THEN //DO NOTHING, ALL OUTPUTS OFF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1452","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1453","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1454","Tag":null,"Text":"(string)    xDecodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1455","Tag":null,"Text":"(string)    eDecodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1456","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1457","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1458","Tag":null,"Text":"(string)    xEncodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1459","Tag":null,"Text":"(string)    eEncodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1460","Tag":null,"Text":"(string)ELSIF xDecode AND NOT xEncode THEN //Decode"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1461","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1462","Tag":null,"Text":"(string)    xDecodeBusy := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1463","Tag":null,"Text":"(string)    xDecodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1464","Tag":null,"Text":"(string)    eDecodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1465","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1466","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1467","Tag":null,"Text":"(string)    xEncodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1468","Tag":null,"Text":"(string)    eEncodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1469","Tag":null,"Text":"(string)ELSIF NOT xDecode AND xEncode THEN //Encode"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1470","Tag":null,"Text":"(string)    xDecodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1471","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1472","Tag":null,"Text":"(string)    xDecodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1473","Tag":null,"Text":"(string)    eDecodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1474","Tag":null,"Text":"(string)    xEncodeDone := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1475","Tag":null,"Text":"(string)    xEncodeBusy := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1476","Tag":null,"Text":"(string)    xEncodeError := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1477","Tag":null,"Text":"(string)    eEncodeError := ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1478","Tag":null,"Text":"(string)END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1479","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1480","Tag":null,"Text":"(string)IF xDecodeBusy THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1481","Tag":null,"Text":"(string)    InitializeStructure();"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1482","Tag":null,"Text":"(string)    eDecodeState := PayloadDecodeStates.object_getlength;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1483","Tag":null,"Text":"(string)    //decode length"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1484","Tag":null,"Text":"(string)    dviTemp := OwnerPayload.DecodeNextVarInt(); //updates i to end of the varint"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1485","Tag":null,"Text":"(string)    lengthOfObject := dviTemp.int32;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1486","Tag":null,"Text":"(string)    finalByteIndex := ProtobufBlobIndex + lengthOfObject;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1487","Tag":null,"Text":"(string)    ProtobufBlobIndex := ProtobufBlobIndex + 1;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1488","Tag":null,"Text":"(string)    eDecodeState := PayloadDecodeStates.object_getmember;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1489","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1490","Tag":null,"Text":"(string)    //for i to i + length - 1"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1491","Tag":null,"Text":"(string)    FOR ProtobufBlobIndex := ProtobufBlobIndex TO finalByteIndex DO"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1492","Tag":null,"Text":"(string)        CASE eDecodeState OF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1493","Tag":null,"Text":"(string)            PayloadDecodeStates.object_getmember:"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1494","Tag":null,"Text":"(string)                CASE myProtobufBlob[ProtobufBlobIndex] OF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1495","Tag":null,"Text":"(string)                    16#00: //end of data? padding byte? ERROR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1496","Tag":null,"Text":"(string)                        xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1497","Tag":null,"Text":"(string)                        eDecodeError := ERROR.PayloadFound00;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1498","Tag":null,"Text":"(string)                        ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1499","Tag":null,"Text":"(string)                    ProtobufedId.Row_elements:"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1500","Tag":null,"Text":"(string)                        eDecodeState := PayloadDecodeStates.object_getelement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1501","Tag":null,"Text":"(string)                ELSE //extension... error"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1502","Tag":null,"Text":"(string)                    xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1503","Tag":null,"Text":"(string)                    eDecodeError := ERROR.PayloadFoundExtensions;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1504","Tag":null,"Text":"(string)                    ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1505","Tag":null,"Text":"(string)                END_CASE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1506","Tag":null,"Text":"(string)            PayloadDecodeStates.object_getelement:"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1507","Tag":null,"Text":"(string)                //So i imagine, a metric should be able to decode itself, in one go"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1508","Tag":null,"Text":"(string)                recentlyClaimedElement REF= AddElementBlank(OwnerPayload := OwnerPayload,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1509","Tag":null,"Text":"(string)                    eError => eDecodeError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1510","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1511","Tag":null,"Text":"(string)                IF eDecodeError = ERROR.NO_ERROR THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1512","Tag":null,"Text":"(string)                    //i starts off now pointing to the first byte of the Metric"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1513","Tag":null,"Text":"(string)                    THIS^.recentlyClaimedElement(xDecode := TRUE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1514","Tag":null,"Text":"(string)                        xEncode := FALSE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1515","Tag":null,"Text":"(string)                        protobufBlobMaxIndex := protobufBlobMaxIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1516","Tag":null,"Text":"(string)                        OwnerPayload := OwnerPayload,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1517","Tag":null,"Text":"(string)                        ProtobufBlobIndex := ProtobufBlobIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1518","Tag":null,"Text":"(string)                        myProtobufBlob := myProtobufBlob,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1519","Tag":null,"Text":"(string)                        xDecodeDone =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1520","Tag":null,"Text":"(string)                        xDecodeBusy =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1521","Tag":null,"Text":"(string)                        xDecodeError => xDecodeError,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1522","Tag":null,"Text":"(string)                        eDecodeError => eDecodeError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1523","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1524","Tag":null,"Text":"(string)                    IF recentlyClaimedElement.xDecodeDone THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1525","Tag":null,"Text":"(string)                        //SUCCESS! the latest object has now been decoded"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1526","Tag":null,"Text":"(string)                        //i is now pointing to the very last byte of the object"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1527","Tag":null,"Text":"(string)                        eDecodeState := PayloadDecodeStates.object_getmember;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1528","Tag":null,"Text":"(string)                    ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1529","Tag":null,"Text":"(string)                        ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1530","Tag":null,"Text":"(string)                    END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1531","Tag":null,"Text":"(string)                ELSE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1532","Tag":null,"Text":"(string)                    xDecodeError := TRUE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1533","Tag":null,"Text":"(string)                    //eDecodeError := ERROR.Can't Claim Metric;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1534","Tag":null,"Text":"(string)                    ProtobufBlobIndex := protobufBlobMaxIndex; //break out of FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1535","Tag":null,"Text":"(string)                END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1536","Tag":null,"Text":"(string)        END_CASE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1537","Tag":null,"Text":"(string)    END_FOR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1538","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1539","Tag":null,"Text":"(string)    IF NOT xDecodeError THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1540","Tag":null,"Text":"(string)        ProtobufBlobIndex := ProtobufBlobIndex - 1; //i is now final byte index.\t"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1541","Tag":null,"Text":"(string)    END_IF"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1542","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1543","Tag":null,"Text":"(string)    eDecodeState := PayloadDecodeStates.idle;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1544","Tag":null,"Text":"(string)    xDecodeDone := NOT xDecodeError;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1545","Tag":null,"Text":"(string)    xDecodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1546","Tag":null,"Text":"(string)END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1547","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1548","Tag":null,"Text":"(string)IF xEncodeBusy THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1549","Tag":null,"Text":"(string)    //NOTE: BLOB Data will not be initialized to 00."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1550","Tag":null,"Text":"(string)    //But we will start with a 0 byte payload."}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1551","Tag":null,"Text":"(string)    //store the starting byte, because we need it right at the end"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1552","Tag":null,"Text":"(string)    startingByteOfEncodedData := ProtobufBlobIndex;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1553","Tag":null,"Text":"(string)    //Encode All Elements"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1554","Tag":null,"Text":"(string)    _elements.ItterateRestart(HasNext => _COL_HasNext);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1555","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1556","Tag":null,"Text":"(string)    WHILE _COL_HasNext AND (eEncodeError = ERROR.NO_ERROR) DO"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1557","Tag":null,"Text":"(string)        _elements.ItterateNext(itfElement => _COL_Element,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1558","Tag":null,"Text":"(string)            HasNext => _COL_HasNext);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1559","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1560","Tag":null,"Text":"(string)        IF __QUERYPOINTER(_COL_Element,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1561","Tag":null,"Text":"(string)            nextELementToEncode) THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1562","Tag":null,"Text":"(string)            nextELementToEncode^(xDecode := FALSE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1563","Tag":null,"Text":"(string)                xEncode := TRUE,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1564","Tag":null,"Text":"(string)                protobufBlobMaxIndex := protobufBlobMaxIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1565","Tag":null,"Text":"(string)                OwnerPayload := OwnerPayload,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1566","Tag":null,"Text":"(string)                ProtobufBlobIndex := ProtobufBlobIndex,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1567","Tag":null,"Text":"(string)                myProtobufBlob := myProtobufBlob,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1568","Tag":null,"Text":"(string)                xDecodeDone =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1569","Tag":null,"Text":"(string)                xDecodeBusy =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1570","Tag":null,"Text":"(string)                xDecodeError =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1571","Tag":null,"Text":"(string)                eDecodeError =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1572","Tag":null,"Text":"(string)                xEncodeDone =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1573","Tag":null,"Text":"(string)                xEncodeBusy =>,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1574","Tag":null,"Text":"(string)                xEncodeError => xEncodeError,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1575","Tag":null,"Text":"(string)                eEncodeError => eEncodeError);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1576","Tag":null,"Text":"(string)        END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1577","Tag":null,"Text":"(string)    END_WHILE"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1578","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1579","Tag":null,"Text":"(string)    //Field number and length and we're done!"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1580","Tag":null,"Text":"(string)    IF eEncodeError = ERROR.NO_ERROR THEN"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1581","Tag":null,"Text":"(string)        //{info 'todo: i-campbell Make these field numbers a GVL'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1582","Tag":null,"Text":"(string)        eEncodeError := OwnerPayload.ReencodeLengthDelimited(ProtobufFieldNumber := 4,"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1583","Tag":null,"Text":"(string)            startingByteOfEncodedData := startingByteOfEncodedData);"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1584","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1585","Tag":null,"Text":"(string)        xEncodeError := eEncodeError <> ERROR.NO_ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1586","Tag":null,"Text":"(string)    END_IF;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1587","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1588","Tag":null,"Text":"(string)    //DONE :)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1589","Tag":null,"Text":"(string)    xEncodeDone := NOT xEncodeError;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1590","Tag":null,"Text":"(string)    xEncodeBusy := FALSE;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)9","Tag":null,"Text":"(string)END_IF;"}}]}}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextLines":{"@Type":"[a5de0b0b]","@Value":[{"@Type":"a5de0b0b","@Value":{"Id":"(long)1404","Tag":null,"Text":"(string){attribute 'hide'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1591","Tag":null,"Text":"(string){attribute 'no_assign'}"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1405","Tag":null,"Text":"(string)FUNCTION_BLOCK FB_PayloadRow IMPLEMENTS LinkedList.IElement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1406","Tag":null,"Text":"(string)VAR_INPUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1407","Tag":null,"Text":"(string)    (*Trigers for conversion*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1408","Tag":null,"Text":"(string)    xDecode : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1409","Tag":null,"Text":"(string)    xEncode : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1410","Tag":null,"Text":"(string)    protobufBlobMaxIndex : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1411","Tag":null,"Text":"(string)    PoolManager : IPoolManager;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1412","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1413","Tag":null,"Text":"(string)VAR_IN_OUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1414","Tag":null,"Text":"(string)    OwnerPayload : FB_Payload; //He manages the assigning of Pool Objects"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1415","Tag":null,"Text":"(string)    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"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1416","Tag":null,"Text":"(string)    myProtobufBlob : ARRAY[*] OF BYTE; //array of bytes containing the protobuf payload.  If the array is the whole"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1417","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1418","Tag":null,"Text":"(string)VAR_OUTPUT"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1419","Tag":null,"Text":"(string)    xDecodeDone, xDecodeBusy, xDecodeError : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1420","Tag":null,"Text":"(string)    eDecodeError : ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1421","Tag":null,"Text":"(string)    xEncodeDone, xEncodeBusy, xEncodeError : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1422","Tag":null,"Text":"(string)    eEncodeError : ERROR;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1423","Tag":null,"Text":"(string)END_VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1424","Tag":null,"Text":"(string)VAR"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1425","Tag":null,"Text":"(string)    (*Internal variables*)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1426","Tag":null,"Text":"(string)    dviTemp : DecodedVarInt;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1427","Tag":null,"Text":"(string)    startingByteOfEncodedData : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1428","Tag":null,"Text":"(string)    eDecodeState : PayloadDecodeStates;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1429","Tag":null,"Text":"(string)    lengthOfObject : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1430","Tag":null,"Text":"(string)    finalByteIndex : DINT;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1431","Tag":null,"Text":"(string)    recentlyClaimedElement : REFERENCE TO FB_PayloadElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1432","Tag":null,"Text":"(string)    nextELementToEncode : POINTER TO FB_PayloadElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1433","Tag":null,"Text":"(string)    _elements : LinkedList.List; // Of FB_PayloadElement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1434","Tag":null,"Text":"(string)    _COL_HasNext : BOOL;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1435","Tag":null,"Text":"(string)    _COL_Element : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1436","Tag":null,"Text":"(string)"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1437","Tag":null,"Text":"(string)    // LinkedList.IElement"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1438","Tag":null,"Text":"(string)    _itfPrev : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1439","Tag":null,"Text":"(string)    _itfNext : LinkedList.IElement;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1440","Tag":null,"Text":"(string)    _itfList : LinkedList.IList;"}},{"@Type":"a5de0b0b","@Value":{"Id":"(long)1","Tag":null,"Text":"(string)END_VAR"}}]}}}}},"UniqueIdGenerator":"(string)1591","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"}