Can I get the POU name or any other application, task information in IEC application or in C? just like FUNC in C.
It will be very helpful to locate the exceptions or bugs of my applications.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is how to get the application information in runtime
FUNCTIONGetAppInfo:BOOL(*'******************************************************************************'*ThisFunctiongetstheapplicationinformation.'*'*FunctionrequiresthesystemlibraryCmpApp'* '********************************************************************************)VAR_OUTPUTÂ Â strProjectName:STRING(255);Â Â strDescription:STRING(255);Â Â strProfile:STRING(255);Â Â strVersion:STRING(255);Â Â strLastChanges:STRING(255);END_VARVARÂ Â tResult:DWORD;Â Â tFirstApp:POINTERTOAPPLICATION;Â Â pAppInfo:POINTERTOAPPLICATION_INFO;Â Â pString:POINTERTOSTRING;END_VAR
tFirstApp :=AppGetFirstApp(pResult :=tResult);IFtFirstApp<>0THEN
  pAppInfo :=AppGetApplicationInfo(tFirstApp, tResult);
  strProjectName :=pAppInfo^.pstProjectName^;
  strDescription:=pAppInfo^.pstDescription^;
  strProfile:=pAppInfo^.pstProfile^;
  strVersion:=pAppInfo^.pstVersion^;
  strLastChanges:=DT_TO_STRING(pAppInfo^.dtLastChanges);END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can I get the POU name or any other application, task information in IEC application or in C? just like FUNC in C.
It will be very helpful to locate the exceptions or bugs of my applications.
Search in the help for: "Attribute Instance-path"
This will explain what you are looking for.
This is how to get the application information in runtime