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

Retrieving project settings and device information programmatically

Kim
2016-06-22
2016-07-04
  • Kim - 2016-06-22

    I have a project with an EtherCAT master, a Modbus TCP master and a Modbus RTU master.
    We are making automated tests and part of the result should be information regarding the devices and project settings.

    I've used CmpIECTask to obtain what I need from the task settings, works fine.

    But how can I obtain the following information programmatically during runtime?

    I'm aware not all of this will be possible to obtain, but please hint me on how to obtain what I can.

    Kim Hansen
    Beijer Electronics Automation AB

     
  • learnetk - 2016-06-22

    Hi,
    I think you should look at the CmpApp library, there is also an example on Store. Look for Applicationmanager in Codesys store.

     
  • travlytle - 2016-06-24

    You can use the CmpApp like so:

    PROGRAM Version_POU
    VAR
    pApp: POINTER TO APPLICATION;
    tResult: POINTER TO RTS_IEC_RESULT;
    pAppInfo: POINTER TO APPLICATION_INFO;
    strProjectName: STRING(255);
    strAuthor: STRING(255);
    strVersion: STRING(255);
    strDescription: STRING(255);
    strProfile: STRING(255);
    strLastChanges: STRING;
    END_VAR

    // Project Name, Author, Version, Description, Profile, and Last Changes
    pApp := AppGetFirstApp(pResult := tResult);
    IF pApp <> 0 THEN
    pAppInfo :=AppGetApplicationInfo(pApp, tResult);
    strProjectName :=pAppInfo^.pstProjectName^;
    strAuthor := pAppInfo^.pstAuthor^;
    strVersion:=pAppInfo^.pstVersion^;
    strDescription:=pAppInfo^.pstDescription^;
    strProfile:=pAppInfo^.pstProfile^;
    strLastChanges:=DT_TO_STRING(pAppInfo^.dtLastChanges);
    END_IF

    This will display the settings show under Project -> Project Information

    Getting library version, I'm not sure how to do.

     
  • josepmariarams - 2016-06-24

    I need the same as you to know about the input outputs of every devices.

    I have use the iostandard library. There is a function which returns an array of ioconnectors. And every connector has an array of iodevicesparameters.

    But at the end I can't get the iomaps.

    I cannot find information about the devices parΓ metres.

    Enviat des del meu Aquaris M5.5 usant Tapatalk

     
  • Kim - 2016-07-04

    learnetk hat geschrieben:
    Hi,
    I think you should look at the CmpApp library, there is also an example on Store. Look for Applicationmanager in Codesys store.

    Thank you, but CmpApp does not provide what I'm looking for.
    I'm starting to think the information I want is not within the compiled file or simply not accessible by code.

     
  • eschwellinger

    eschwellinger - 2016-07-04

    Hi Kim,
    I could give you two of your wanted Information:

    //Compiler Version
    ver := __SYSTEM.Constants.CompilerVersion;
    //Ethercat Master Version
    Ethercat_Master.m_info.szFirmwareVersion;

    BR
    Edwin

    IMG: Compiler_and_EthercatVersion.jpg

     

Log in to post a comment.