[ac6d98]: / project / sparkplug™_mqtt_edge_b9741afd / function_blocks_d9bd2ff1 / fb_device_309d3c13 / fb_device_98658e3f / imessagesource_7fdd83d5 / getmessage_45e9b6d4 / 45e9b6d4853c441abd29a1ec642b841c.object  Maximize  Restore  History

Download this file

1 lines (1 with data), 5.1 kB

1
{"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)45e9b6d4-853c-441a-bd29-a1ec642b841c","ParentGuid":"(Guid)98658e3f-2022-4201-ad82-e23b1cb5aaf1","Name":"(string)getMessage","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)7fdd83d5-6cb8-42f4-8cd7-5479f3e62c71"}]}}}}]},"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":{"TextBlobForSerialisation":"(string)//Ignore if publishing already!\n//Get the \npSparkplugB := ADR( THIS^._SparkplugB );\n\nIF NOT THIS^._Message_publishing THEN\n    IF _PleasePublishDBIRTH THEN\n        THIS^._Message_publishing := TRUE;\n\n        // Check Edge if Aliases are configured for use\n        IF itfEdge.UseAlias THEN\n            itfEdge.ProvideAlias( AllMetricsList := _Metrics );\n        END_IF\n\n        //getDBIRTH payload\n        IF THIS^._SparkplugB.GetDeviceBirthCertificate( ALLMetricsList := _Metrics, UseAliases := itfEdge.useAlias ) = SPStack.ERROR.NO_ERROR THEN\n\n            pPayload := ADR( THIS^._SparkplugB._Encoder );\n            //getDBIRTH topic : This was set in FB_Device.Initialize\n            pTopic := ADR( THIS^._TopicProvider.DBIRTH );\n            getMessage := TRUE;\n        ELSE\n            THIS^._Message_publishing := FALSE;\n        END_IF\n    ELSIF _PleasePublishDDATA THEN\n        THIS^._Message_publishing := TRUE;\n        //getDDATA payload\n        SPStack.PrepareDATA( pSparkplugB := ADR( _SparkplugB ) );\n\n        IF SPStack.AddChangesToPayload( AllMetricsList := _Metrics,\n                                        pSparkplugB := ADR( _SparkplugB ),\n                                        UseAliases := itfEdge.UseAlias,\n                                        ChangeDetected => ChangesDetected,\n                                        ERRORDetected =>,\n                                        NumberOfChanges => ) =\n            SPStack.ERROR.NO_ERROR AND_THEN\n            ChangesDetected\n            THEN\n            pPayload := ADR( THIS^._SparkplugB._Encoder );\n            //getDDATA topic : This was set in FB_Device.Initialize\n            pTopic := ADR( THIS^._TopicProvider.DDATA );\n            getMessage := TRUE;\n        ELSE\n            THIS^._Message_publishing := FALSE;\n        END_IF\n    ELSIF _PleasePublishDDEATH THEN\n        THIS^._Message_publishing := TRUE;\n\n        //getDDEATH payload\n        IF THIS^._SparkplugB.GetDeviceDeathCertificate() = SPStack.ERROR.NO_ERROR THEN\n            pPayload := ADR( THIS^._SparkplugB._Encoder );\n            //getDDEATH topic : This was set in FB_Device.Initialize\n            pTopic := ADR( THIS^._TopicProvider.DDEATH );\n            getMessage := TRUE;\n        ELSE\n            THIS^._Message_publishing := FALSE;\n        END_IF\n    ELSE\n        getMessage := FALSE;\n    END_IF\nEND_IF","LineInfoPersistence":"(string)45e9b6d4-853c-441a-bd29-a1ec642b841c_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string)// Congratulations! You're going to be published!!\n// Returning TRUE indicates that you accept the deal for exclusive publishing rights!\n// Returns false if you've already given the rights away, OR if you don't even have anything to publish\nMETHOD getMessage : BOOL\nVAR_OUTPUT\n    // contains the unencoded FB_PayloadSimpleEncoder\n    // IMessageSource will not set the SeqNum, this will be done by the publisher!\n    // 0 (Null pointer) if it doesn't want published\n    pSparkplugB : POINTER TO SPStack.FB_SparkplugBxCoderHandler := ADR( THIS^._SparkplugB );\n    pPayload : POINTER TO SPStack.FB_Payload;\n    pTopic : POINTER TO WSTRING( SPStack.GC_sparkplug.supported_string_lengths ); // resembles the topic under which the message is posted\n    // LT#0s if there's no timeout, and the publisher can just sit on your work for ever\n    // Otherwise, you can assume after timeout expires that the publish was unsuccessful.\n    timeout : LTIME;\nEND_VAR\nVAR\n    ChangesDetected : BOOL;\nEND_VAR","LineInfoPersistence":"(string)45e9b6d4-853c-441a-bd29-a1ec642b841c_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"}