1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Initialise := FALSE; // Need to know the task cycle time IF taskhandle <> 0 AND taskhandle <> systypes.RTS_INVALID_HANDLE THEN taskinfo := CmpIecTask.IecTaskGetInfo3(hIecTask := taskhandle, _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_IF // Only use the corrected names throughout EoN! _GroupId := ReplaceIllegalCharsWithUnderscore(GroupId); _NodeName := ReplaceIllegalCharsWithUnderscore(NodeName); _DeviceName := ReplaceIllegalCharsWithUnderscore(DeviceName); // Convert corrected GroupId From WSTRING TO STRING sGroupId := WSTRING_TO_STRING(_GroupId); sNodeName := WSTRING_TO_STRING(_NodeName); sClientID := Concat(sGroupId,sNodeName); MakeValidClientID(sClientID); WriteDeviceLog( UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO), 'EoN GroupId: %s', sGroupId ); |