Read "Application Name" via IEC Code

Anonymous
2019-11-26
2020-01-03
  • Anonymous - 2019-11-26

    Originally created by: massimiliano.legati

    Hi,
    I want to diagnose status of IEC tasks via code using "cmpIecTask" library.
    For Example I want to use "IecTaskGetFirst" with the interface:
    Return - IecTaskGetFirst --- RTS_IEC_HANDLE - Returns the handle to the first IEC task
    Input - pszAppName ----- POINTER TO STRING - Application name
    --------- pResult ------------ POINTER TO RTS_IEC_RESULT - Pointer that returns the runtime system error code

    My problem is the input "pszAppName".
    If I put manually the name of the application in te input everything work fine but I want to create a library than I need to readout the "Application Name" directly from the code.
    Someone know how to read the "Application Name" via IEC-code?

    Thanks!!!!

     
  • e.kislov - 2019-11-26

    Hi.
    Maybe this helps:
    CmpApp library, function AppGetProjectInformation.
    This function return not only project info, but app info too.

     
  • lam.le - 2020-01-03

    You can do something like this:

        char appName[96];
        RTS_HANDLE pInterface;
    pInterface = CAL_IecVarAccGetFirstInterface(NULL);
    
    while (pInterface != RTS_INVALID_HANDLE)
    {
        CAL_IecVarAccGetApplicationName(pInterface, &appName[0], sizeof(appName);
    
        pInterface = CAL_IecVarAccGetNextInterface(pInterface, NULL);
    }
    
     

Log in to post a comment.