Using CmpIecTask library

jauer
2021-10-18
2021-10-19
  • jauer - 2021-10-18

    Hello to the experts,

    I want to use the CmpIecTask library to get the current Jitter value of my program in a variable. Can anyone explain or give an example how I use this library, especially the IecTaskGetInfo3 function (How do I declare the Inputs and how do I use the output?).

    Thank you for your answers :)

     
  • TimvH

    TimvH - 2021-10-18

    Maybe something like this:

    VAR
        Result: CmpIecTask.RTS_IEC_RESULT;
        hTask : CmpIecTask.RTS_IEC_HANDLE;
        pCurrentTaskInfo: POINTER TO Task_Info2;
        CurrentTaskInfo: Task_Info2;
        xReset: BOOL;
    END_VAR
    
    hTask := IecTaskGetCurrent(ADR(Result));
    pCurrentTaskInfo := IecTaskGetInfo3(hIecTask := hTask, pResult := ADR(Result));
    CurrentTaskInfo := pCurrentTaskInfo^;
    
    IF xReset THEN
        xReset := FALSE;
        IF hTask <> 0 THEN
            Result := IecTaskResetStatistics(hIecTask := hTask);
        END_IF
    END_IF
    
     
  • jauer - 2021-10-19

    Thanks for your answer @timvh.
    I tried it but it seems like it doesn´t work. Every variable has the default 0 value and does not change but I don´t know why :(
    Does anyone have suggestions for improvement of the program?

     
  • jauer - 2021-10-19

    Thanks for your answer @timvh.
    I tried it but it seems like it doesn´t work. Every variable has the default 0 value and does not change but I don´t know why :(
    Does anyone have suggestions for improvement of the program?

     
  • jauer - 2021-10-19

    Thanks. With this program I was able to implement my desired program.

     

Log in to post a comment.