[a5a4b0]: / project / sparkplug™_mqtt_host_b9741afd / function_blocks_8ad6e219 / fb_primaryhost_ec6863e3 / fb_primaryhostmessageconsumer_0bdfb382 / consumenbirthmessage_ee0eac84 / ee0eac84c8344e50b4db8007e97dd813.object  Maximize  Restore  History

Download this file

1 lines (1 with data), 6.1 kB

1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)ee0eac84-c834-4e50-b4db-8007e97dd813","ParentGuid":"(Guid)0bdfb382-e83f-44ce-8b28-d26c6658b28d","Name":"(string)ConsumeNBIRTHMessage","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":{"TextBlobForSerialisation":"(string)// Get Edge\nMyEdge REF= pPrimaryHost^.GetEdge( GroupId := pTopicParser^.GroupId,\n                                    EdgeId := pTopicParser^.EdgeId,\n                                    eError => GetEdgeError );\n\nCASE GetEdgeError OF\n    \n    SPStack.ERROR.GroupIDNotFound: // ==> DETECTED NEW GROUP!\n\n        MyGroupId REF= pPrimaryHost^.allocGroupId( GroupId := pTopicParser^.GroupId,\n                                                    eError => allocGroupIdError );\n\n        //log new groupid\n        WriteHostLog( CmpLog.LogClass.LOG_INFO, 'Host registered new GroupID: %s', TO_STRING( pTopicParser^.GroupId ) );\n\n        IF allocGroupIdError = SPStack.ERROR.NO_ERROR THEN\n\n            MyEdge REF= pPrimaryHost^.allocEdgetoGroupId( EdgeId := pTopicParser^.EdgeId,\n                                                           itfGroupID := MyGroupId.itfGroupID,\n                                                           eError => allocEdgetoGroupIdError );\n\n            // Log new remote edge\n            WriteHostLog( CmpLog.LogClass.LOG_INFO, 'Host registered Remote Edge: %s', TO_STRING( pTopicParser^.EdgeId ) );\n\n            IF allocEdgetoGroupIdError = SPStack.ERROR.NO_ERROR THEN\n                MyEdge.ProcessNBIRTH( itfPrimaryHost := pPrimaryHost^,\n                                       pMessage := RecvMesg,\n                                       xError => xProcessNBIRTHError,\n                                       eError => ProcessNBIRTHerror );\n                                       \n            ELSE\n                xProcessNBIRTHError := TRUE;\n                //eError := eError;\n            END_IF\n        ELSE\n            xProcessNBIRTHError := TRUE;\n            //eError := eError;\n        END_IF\n\n        \n    SPStack.ERROR.EdgeIDNotFound: // ==> DETECTED NEW EDGE!\n\n        MyGroupId REF= pPrimaryHost^.GetGroupID( GroupId := pTopicParser^.GroupId,\n                                                  eError => GetGroupIDerror );\n\n        //log new groupid\n        WriteHostLog( CmpLog.LogClass.LOG_INFO, 'Host registered new GroupID: %s', TO_STRING( pTopicParser^.GroupId ) );\n\n        IF eError = SPStack.ERROR.NO_ERROR THEN\n            MyEdge REF= pPrimaryHost^.allocEdgetoGroupId( EdgeId := pTopicParser^.EdgeId,\n                                                           itfGroupID := MyGroupId.itfGroupID,\n                                                           eError => allocEdgetoGroupIdError );\n\n            // Log new remote edge\n            WriteHostLog( CmpLog.LogClass.LOG_INFO, 'Host registered Remote Edge: %s', TO_STRING( pTopicParser^.EdgeId ) );\n\n            IF eError = SPStack.ERROR.NO_ERROR THEN\n                MyEdge.ProcessNBIRTH( itfPrimaryHost := pPrimaryHost^,\n                                       pMessage := RecvMesg,\n                                       xError => xProcessNBIRTHError,\n                                       eError => ProcessNBIRTHerror );\n                                       \n            ELSE\n                xProcessNBIRTHError := TRUE;\n                //eError := eError;\n            END_IF\n        ELSE\n            xProcessNBIRTHError := TRUE;\n            //eError := eError;\n        END_IF\n\n        \n    SPStack.ERROR.NO_ERROR: // ==> UPDATE EXISTING EDGE\n\n        MyEdge.ProcessNBIRTH( itfPrimaryHost := pPrimaryHost^,\n                               pMessage := RecvMesg,\n                               xError => xProcessNBIRTHError,\n                               eError => ProcessNBIRTHerror );\nELSE\n    ; //{info 'TODO: maybe some sort of error??'}\nEND_CASE","LineInfoPersistence":"(string)ee0eac84-c834-4e50-b4db-8007e97dd813_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)METHOD PRIVATE ConsumeNBIRTHMessage\nVAR_INPUT\n    pPrimaryHost : POINTER TO FB_PrimaryHost;\n    pTopicParser : POINTER TO FB_TopicParser; \nEND_VAR\nVAR\n    RecvMesg : REFERENCE TO SPStack.FB_Payload;\n    RecvTopic : WSTRING( SPStack.GC_Sparkplug.supported_string_lengths );\n    MyDevice : REFERENCE TO FB_RemoteDevice;    \n    MyGroupId : REFERENCE TO FB_GroupId;\n    MyEdge : REFERENCE TO FB_RemoteEdge;\nEND_VAR\nVAR_OUTPUT\n    GetEdgeError : SPStack.ERROR; // an error that will be given back by a function, but we can handle the error. \n    allocGroupIdError : SPStack.ERROR; // an error that will be given back by a function, but we can handle the error.\n    allocEdgetoGroupIdError : SPStack.ERROR; // an error that will be given back by a function, but we can handle the error.\n    ProcessNBIRTHerror : SPStack.ERROR; // an error that will be given back by a function, but we can handle the error\n    GetGroupIDerror : SPStack.ERROR; // an error that will be given back by a function, but we can handle the error.\n    xProcessNBIRTHError : BOOL;\nEND_VAR\n","LineInfoPersistence":"(string)ee0eac84-c834-4e50-b4db-8007e97dd813_Decl_LineIds"}}}}}},"TypeInfos":{"3b83b776":"{3b83b776-fb25-43b8-99f2-3c507c9143fc}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","f8a58466":"{f8a58466-d7f6-439f-bbb8-d4600e41d099}","string":"System.String"}}},"FormatVersion":"1.0"}