How can I use the "IoDrvEtherCAT.GetStatistics" method

serer03
2021-12-20
2021-12-20
  • serer03 - 2021-12-20

    I am a beginner,and I want to use the "IoDrvEtherCAT.GetStatistics" method to read the diagnostic message SendFrameCound,I tried many different ideas still can not work,can anybody teach me how can I use this method,thank you!

     
  • eschwellinger

    eschwellinger - 2021-12-20

    snippet:

        // Statistic in IEC of the EtherCAT master  
        Ethercat_master_SoftMotion.GetStatistics(udiSendFrameCount => udiEthSendCount, udiFramesPerSecond => udiEthSendFramesPerSec, 
        udiLostFrameCount => udiEthLostFrameCount, udiTxErrorCount => udiEthTxErrCount, udiRxErrorCount => udiEthRxErrCount);
    
        // The statistics can be cleared via button
        IF _xResetEthStatistics THEN 
            Ethercat_master_SoftMotion.ClearStatistics();
    
            _pdiResetMax := ADR(EtherCAT_Master_SoftMotion.m_Master.m_diMaxSyncTime);
            _pdiResetMin := ADR(EtherCAT_Master_SoftMotion.m_Master.m_diMinSyncTime);
            _pdiResetMax^ := 0;
            _pdiResetMin^ := 0;             // why not 16#7FFFFFF??
            _diAbsMaxSyncTime := 0;
            _diAbsMinSyncTime := 16#7FFFFFF;
            dwEthSendFrameMax := 0;
            dwEthGetFrameMax := 0;
    
            _xResetEthStatistics := FALSE;
        END_IF
    
     

Log in to post a comment.