Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Projektinformationen

Stehmi
2018-05-07
2018-05-15
  • Stehmi - 2018-05-07

    Hallo zusammen, habe leider mit Codesys keine sehr grosse Erfahrung.
    Ein Problem zudem ich kaum etwas finde ist, wie ich die Automatisch erstellten Projekt informationen z.B. in Variable packen kann um diese zu visualisieren.
    Hat mir dazu jemand einen Tip wie ich z.B. GetTitle oder GetVersion benutze?

    waere euch sehr dankbar

     
  • MaxZuck - 2018-05-15

    Hey Stehmi,

    für den Namen hab ich mir das wir unten dargestellt umgesetzt. In APPLICATION_INFO stecken aber auch weitere Informationen, wie der Autor und die Version.

    FUNCTION GetProjectName : STRING(255)
    VAR_INPUT
    END_VAR
    VAR
       pApp: POINTER TO APPLICATION;   
       tResult: POINTER TO CmpApp.RTS_IEC_RESULT;
       pAppInfo: POINTER TO APPLICATION_INFO;
    END_VAR
    (* get the projectname from the system *)
    pApp := AppGetCurrent(pResult:= tResult);
    IF(pApp <> 0) THEN
       pAppInfo := AppGetApplicationInfo(pApp, tResult);
       IF(pAppInfo^.pstProjectName <> 0) THEN
          GetProjectName := pAppInfo^.pstProjectName^;
       ELSE
          GetProjectName := 'unknown projectname';      
       END_IF
    ELSE
       GetProjectName := 'unknown projectname';
    END_IF
    
     

Log in to post a comment.