1 | {"payload":{"meta":{"Graph":{"@Type":"81297157","@Value":{"Guid":"(Guid)98658e3f-2022-4201-ad82-e23b1cb5aaf1","ParentGuid":"(Guid)00000000-0000-0000-0000-000000000000","Name":"(string)FB_Device","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)309d3c13-8889-412c-93b6-19b25897048c"}]}}}}]},"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":{"TextBlobForSerialisation":"(string)PluggedIntoEoN := IsPluggedIntoEoN( pEoN => _pEoN );\n_EoNOnline := IsEoNOnline( pEoN := _pEoN,\n PluggedIntoEoN := PluggedIntoEoN,\n CurSessionState => SessionState );\n\nIF PluggedIntoEoN THEN\n _MQTT( Client := _pEoN^._MQTT._Client );\n\n IF _MQTT.DCMDMessageReceived() THEN\n _RecvDCMDMesg REF= _MQTT.GetDCMDMessage( MessageTopic => _RecvDCMDTopic );\n onDCMDMessage( pTopic := ADR( _RecvDCMDTopic ),\n pMessage := _RecvDCMDMesg );\n END_IF\n\n // IF EoN transitions from OFFLINE TO ONLINE we issue a rebirth.\n _PublishReBirth := _pEoN^.IsReDBirthNeeded();\nEND_IF\n\n_StateMachine( pEoN := _pEoN,\n pDevice := THIS,\n NodeName := EoNName,\n DeviceName := _cDeviceName,\n IsPluggedIntoEoN := PluggedIntoEoN,\n IsHealthy := DeviceHealthy,\n IsEoNOnline := _EoNOnline,\n ReBirth := _PublishReBirth,\n TimeToWait := TO_TIME( publishPeriod ),\n PublishDone := _informPublishDone,\n PublishError := _informPublishError,\n SessionState => SessionState,\n AllMetricsList := _Metrics );\n\n_PublishReBirth := FALSE;\nDiag();","LineInfoPersistence":"(string)98658e3f-2022-4201-ad82-e23b1cb5aaf1_Impl_LineIds"}}}},"Interface":{"@Type":"a9ed5b7e","@Value":{"TextDocument":{"@Type":"f3878285","@Value":{"TextBlobForSerialisation":"(string){attribute 'no_assign'}\n{attribute 'reflection'}\nFUNCTION_BLOCK FB_Device IMPLEMENTS IDevice\nVAR_INPUT\n DeviceName : WSTRING; // A name for this device\n // Setting this value false will send a DDEATH, so all values will be shown bad on the Sparkplug SCADA\n // Setting this value true will permit a DBIRTH to be sent, so all values will be shown healthy.\n DeviceHealthy : BOOL := TRUE;\n itfEdge : IEdge; // Connect EoN instance \nEND_VAR\nVAR_OUTPUT\n PluggedIntoEoN : BOOL;\n EoNName : WSTRING;\n SessionState : SPStack.SparkplugSessionStateType := SPStack.SparkplugSessionStateType.OFFLINE;\nEND_VAR\nVAR_IN_OUT\n publishPeriod : UINT; // eg: 5000 (Value is in milliseconds) \nEND_VAR\nVAR\n _cDeviceName : WSTRING; // corrected devicename\n _Element : FB_DeviceElem; // needed for list and element usage\n _pEoN : POINTER TO FB_Edge;\n _EoNOnline : BOOL;\n _Initialised : BOOL;\n _TopicProvider : SPStack.FB_DeviceTopicProvider;\n _MQTT : FB_DeviceMQTT;\n _Metrics : LinkedList.List; // Complete List of all metrics the device will send during its \"life\"\n _StateMachine : FB_DeviceStateMachine;\n _SparkplugB : SPStack.FB_SparkplugBxCoderHandler;\n _Blob : ARRAY[ 0..65535 ] OF BYTE; // buffer for encoded messages\n _BlobSize : UDINT; // current encoded message size\n _Diag : STRING;\n // DBirth\n _CurrentPublishBirth : UINT;\n _LastPublishBirth : UINT;\n _StatusBirthPublished : BOOL;\n _PublishBirth : BOOL;\n _PublishReBirth : BOOL;\n DBIRTHDone : F_TRIG;\n // DDATA\n _CurrentPublishData : UINT;\n _LastPublishData : UINT;\n _PublishData : BOOL;\n // DCMD\n _RecvDCMDMesg : REFERENCE TO SPStack.FB_Payload;\n _RecvDCMDTopic : WSTRING( SPStack.GC_sparkplug.supported_string_lengths );\n //IMessageSource\n _informPublishDone : BOOL;\n _informPublishError : BOOL;\n _informPublishDoneOrError : SPStack.ERROR;\n _PleasePublishDBIRTH : BOOL;\n _PleasePublishDDATA : BOOL;\n _PleasePublishDDEATH : BOOL;\n _Message_publishing : BOOL;\n\n {attribute 'instance-path'}\n {attribute 'noinit'}\n _POU : STRING;\nEND_VAR","LineInfoPersistence":"(string)98658e3f-2022-4201-ad82-e23b1cb5aaf1_Decl_LineIds"}}}},"UniqueIdGenerator":"(string)8209","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}","a9ed5b7e":"{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}","ArrayList":"System.Collections.ArrayList","bool":"System.Boolean","f3878285":"{f3878285-8e4f-490b-bb1b-9acbb7eb04db}","string":"System.String"}}},"FormatVersion":"1.0"} |