EtherCat Master running or Not

skalakope
2022-01-18
2022-01-18
  • skalakope - 2022-01-18

    Dear All,

    I am using EtherCat Master in my project, and I am testing it. My problem is, that I can not catch any status. In the input assistant, I could find the following:
    IoConfig_Globals.EtherCAT_Master.xError -> it is boolean, and according to the explanation:
    "The output is TRUE when
    an error occurs when starting the EtherCAT stack, or
    communication with the slaves is interrupted because no more messages can be received (for example, due to a damaged cable)."

    Based on it, I have added to my ST this one:
    e:=IoConfig_Globals.EtherCAT_Master.xError;

    Where e is boolean variables.

    But it always FALSE. If the program is running, I unplug the EtherCat EK1100 from the power, and in the Codesys I can see the red triangles next to the EtherCat master etc., but the variable is still FALSE.

    How can I check it during the run? Is there any other solution to check does the Master run properly or not?

    Thank You in advance!

     
  • eschwellinger

    eschwellinger - 2022-01-18

    Hi,
    you need to call the global Master instance in your code to have these variables up to date.

    Ethercat_Master();
    xconfigfinished:=Ethercat_Master.xConfigFinished;
    xError:=Ethercat_Master.xError;
    
     
    πŸ‘
    1
  • skalakope - 2022-01-18

    Dear eschwellinger!

    Thank You for your rapid help! It works now.

     

Log in to post a comment.