--- a/branches/h-hermsen/mqttsparkplugb/SparkplugB/Function Blocks/FB_Edge_Of_Network_Node/FB_Edge_Of_Network_Node/Initialise/svnobj
+++ b/branches/h-hermsen/mqttsparkplugb/SparkplugB/Function Blocks/FB_Edge_Of_Network_Node/FB_Edge_Of_Network_Node/Initialise/svnobj
@@ -1,6 +1,6 @@
-Gx_lê2!0…jüoé)Ñ>†¿Ù#0}ðSystem.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
+Gx_l*1!0…jüo)(H´«ÆÙ“0‚ÂSystem.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
 longTagText
(Initialise := FALSE;F// Need to know the task cycle timetaskhandle := CmpIecTask.IecTaskGetCurrent(pResult := ADR(dummyresult));ŠIF taskhandle <> 0 AND taskhandle <> systypes.RTS_INVALID_HANDLE THEN~	taskinfo := CmpIecTask.IecTaskGetInfo3(hIecTask := taskhandle,Œ	                                        pResult := ADR(dummyresult));H	IF dummyresult = Errors.ERR_OK THEN¢		_taskCycleTime := taskinfo^.dwInterval / 1000; //dwInterval is cycle time in ¼s
-	ELSE,		_taskCycleTime := 1;Ì		WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_WARNING), 'Could not get Task Interval %s', '' );	END_IFELSE*	_taskCycleTime := 1;Ê	WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_WARNING), 'Could not get Task Interval %s', '' );END_IF^// Only use the corrected names throughout EoN!n_GroupId := ReplaceIllegalCharsWithUnderscore(GroupId); r_NodeName := ReplaceIllegalCharsWithUnderscore(NodeName);!z_DeviceName := ReplaceIllegalCharsWithUnderscore(DeviceName);"f// Convert corrected GroupId From WSTRING TO STRING#PsGroupId := WSTRING_TO_STRING(_GroupId);$TsNodeName := WSTRING_TO_STRING(_NodeName);%PsClientID := Concat(sGroupId,sNodeName);&:MakeValidClientID(sClientID);'´WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN ClientId: %s', sClientID );(°WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN GroupId: %s', sGroupId );)ÊWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN NodeName: %s', TO_STRING(_NodeName) );*ÒWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN DeviceName: %s', TO_STRING(_DeviceName) );+ÐWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Connecting with Server: %s', ServerUrl );,øWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Connecting on Server Port: %s', UINT_TO_STRING(ServerPort) );-îWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Session KeepAlive: %s sec', UINT_TO_STRING(KeepAlive) );.F// Setup the MQTT client connection/F_MQTT.SetBroker(sUrl := ServerUrl, 0L                uiPort := ServerPort, 1T                uiKeepAlive := KeepAlive);2âWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN CleanSession: %s', BOOL_TO_STRING(CleanSession) );3ÐWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN User: %s', WSTRING_TO_STRING(Username) );4®WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Pass: %s', '********' );5(// Setup Credentials6v_MQTT.SetSessionCredentials(xCleanSession := CleanSession, 7h                            sClientID := sClientID, 8`                            wsUser := Username, 9`                            wsPass := Password);:// Setup TLS;L_MQTT.SetSessionTLS(xUseTLS := UseTLS,<J                    hCert := hCert );=®WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN TLS Certificate Handle: %s', SEL(UseTLS, 'None', TO_STRING(hCert)));                    >ÞWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN TLS : %s', SEL(UseTLS, 'Disabled', 'Enabled') );?x(* Create the AllMetricsList by adding all metrics which we @|   ever will send, after setting the lastWill we cannot alter AŒ   (add/remove metrics) AllMetricsList! *)                            BªComposeError := _SparkPlugB.ListComposer( arSparkplugBoolean  := arSparkplugBoolean, C¬                                          arSparkplugDateTime := arSparkplugDateTime, D¦                                          arSparkplugFloat    := arSparkplugFloat, E¨                                          arSparkplugDouble   := arSparkplugDouble, F¤                                          arSparkplugInt8     := arSparkplugInt8, G¦                                          arSparkplugInt16    := arSparkplugInt16, H¦                                          arSparkplugInt32    := arSparkplugInt32, I¦                                          arSparkplugInt64    := arSparkplugInt64, J¦                                          arSparkplugUInt8    := arSparkplugUInt8, K¨                                          arSparkplugUInt16   := arSparkplugUInt16, L¨                                          arSparkplugUInt32   := arSparkplugUInt32, M¨                                          arSparkplugUInt64   := arSparkplugUInt64, N¤                                          arSparkplugUUID     := arSparkplugUUID, O¤                                          arSparkplugText     := arSparkplugText, P¨                                          arSparkplugString   := arSparkplugString, Q¦                                          CompleteList        := _AllMetricsList );R       Sx// set Lastwill, the _AllMetricsList is now set in concrete T¤LastWillSet := SetLastWillAndTestament( AllMetricsList := THIS^._AllMetricsList );UÒWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN LW&T: %s ', BOOL_TO_STRING(LastWillSet) );V&Initialise := TRUE;WInterfaceXL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}Y${attribute 'hide'}Z@METHOD PRIVATE Initialise : BOOL[VAR\&	sGroupId : STRING;](	sNodeName : STRING;^2    ComposeError : Error;_.    LastWillSet : BOOL;`(	sClientID : STRING;aN	dummyresult : systypes.RTS_IEC_RESULT;bL	taskhandle : systypes.RTS_IEC_HANDLE;cZ	taskinfo : POINTER TO CmpIecTask.Task_Info2;dEND_VARÐÐÐEQÐÐ	
+	ELSE,		_taskCycleTime := 1;Ì		WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_WARNING), 'Could not get Task Interval %s', '' );	END_IFELSE*	_taskCycleTime := 1;Ê	WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_WARNING), 'Could not get Task Interval %s', '' );END_IF^// Only use the corrected names throughout EoN!n_GroupId := ReplaceIllegalCharsWithUnderscore(GroupId); r_NodeName := ReplaceIllegalCharsWithUnderscore(NodeName);!z_DeviceName := ReplaceIllegalCharsWithUnderscore(DeviceName);"f// Convert corrected GroupId From WSTRING TO STRING#PsGroupId := WSTRING_TO_STRING(_GroupId);$TsNodeName := WSTRING_TO_STRING(_NodeName);%PsClientID := Concat(sGroupId,sNodeName);&:MakeValidClientID(sClientID);'´WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN ClientId: %s', sClientID );(°WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN GroupId: %s', sGroupId );)ÊWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN NodeName: %s', TO_STRING(_NodeName) );*ÒWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN DeviceName: %s', TO_STRING(_DeviceName) );+ÐWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Connecting with Server: %s', ServerUrl );,øWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Connecting on Server Port: %s', UINT_TO_STRING(ServerPort) );-îWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Session KeepAlive: %s sec', UINT_TO_STRING(KeepAlive) );.F// Setup the MQTT client connection/F_MQTT.SetBroker(sUrl := ServerUrl, 0L                uiPort := ServerPort, 1T                uiKeepAlive := KeepAlive);2âWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN CleanSession: %s', BOOL_TO_STRING(CleanSession) );3ÐWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN User: %s', WSTRING_TO_STRING(Username) );4®WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN Pass: %s', '********' );5(// Setup Credentials6v_MQTT.SetSessionCredentials(xCleanSession := CleanSession, 7h                            sClientID := sClientID, 8`                            wsUser := Username, 9`                            wsPass := Password);:// Setup TLS;L_MQTT.SetSessionTLS(xUseTLS := UseTLS,<J                    hCert := hCert );=®WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN TLS Certificate Handle: %s', SEL(UseTLS, 'None', TO_STRING(hCert)));                    >ÞWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN TLS : %s', SEL(UseTLS, 'Disabled', 'Enabled') );?x(* Create the AllMetricsList by adding all metrics which we @|   ever will send, after setting the lastWill we cannot alter AŒ   (add/remove metrics) AllMetricsList! *)                            BŽComposeError := ListComposer(arSparkplugBoolean  := arSparkplugBoolean,C                             arSparkplugDateTime := arSparkplugDateTime,DŠ                             arSparkplugFloat    := arSparkplugFloat,EŒ                             arSparkplugDouble   := arSparkplugDouble,Fˆ                             arSparkplugInt8     := arSparkplugInt8,GŠ                             arSparkplugInt16    := arSparkplugInt16,HŠ                             arSparkplugInt32    := arSparkplugInt32,IŠ                             arSparkplugInt64    := arSparkplugInt64,JŠ                             arSparkplugUInt8    := arSparkplugUInt8,KŒ                             arSparkplugUInt16   := arSparkplugUInt16,LŒ                             arSparkplugUInt32   := arSparkplugUInt32,MŒ                             arSparkplugUInt64   := arSparkplugUInt64,Nˆ                             arSparkplugUUID     := arSparkplugUUID,Oˆ                             arSparkplugText     := arSparkplugText,PŒ                             arSparkplugString   := arSparkplugString,QŠ                             CompleteList        := _AllMetricsList);R       Sx// set Lastwill, the _AllMetricsList is now set in concrete T¤LastWillSet := SetLastWillAndTestament( AllMetricsList := THIS^._AllMetricsList );UÒWriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN LW&T: %s ', BOOL_TO_STRING(LastWillSet) );V&Initialise := TRUE;WInterfaceXL{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}Y${attribute 'hide'}Z@METHOD PRIVATE Initialise : BOOL[VAR\&	sGroupId : STRING;](	sNodeName : STRING;^2    ComposeError : Error;_.    LastWillSet : BOOL;`(	sClientID : STRING;aN	dummyresult : systypes.RTS_IEC_RESULT;bL	taskhandle : systypes.RTS_IEC_HANDLE;cZ	taskinfo : POINTER TO CmpIecTask.Task_Info2;dEND_VARÐÐÐEQÐÐ	
 ­ZÚÐ-
ÐÐ	
 ­žÚÐ-ÐÐ	
 ­ÚÐ-ÐÐ	
@@ -60,21 +60,21 @@
 ­}ÚÐ-?ÐÐ	
 ­~ÚÐ-@ÐÐ	
 ­ÚÐ-AÐÐ	
-­€ÚÐ-BÐÐ	
-­ÚÐ-CÐÐ	
-­‚ÚÐ-DÐÐ	
-­ƒÚÐ-EÐÐ	
-­„ÚÐ-FÐÐ	
-­…ÚÐ-GÐÐ	
-­†ÚÐ-HÐÐ	
-­‡ÚÐ-IÐÐ	
-­ˆÚÐ-JÐÐ	
-­‰ÚÐ-KÐÐ	
-­ŠÚÐ-LÐÐ	
-­‹ÚÐ-MÐÐ	
-­ŒÚÐ-NÐÐ	
-­ÚÐ-OÐÐ	
-­ŽÚÐ-PÐÐ	
+­°ÚÐ-BÐÐ	
+­±ÚÐ-CÐÐ	
+­²ÚÐ-DÐÐ	
+­³ÚÐ-EÐÐ	
+­´ÚÐ-FÐÐ	
+­µÚÐ-GÐÐ	
+­¶ÚÐ-HÐÐ	
+­·ÚÐ-IÐÐ	
+­¸ÚÐ-JÐÐ	
+­¹ÚÐ-KÐÐ	
+­ºÚÐ-LÐÐ	
+­»ÚÐ-MÐÐ	
+­¼ÚÐ-NÐÐ	
+­½ÚÐ-OÐÐ	
+­¾ÚÐ-PÐÐ	
 ­ÚÐ-QÐÐ	
 ­ÚÐ-RÐÐ	
 ­‘ÚÐ-SÐÐ