jhenning Posted December 28, 2022 Share Posted December 28, 2022 We have a CK3E (FW 2.7.0.0) with 31 EtherCAT slaves attached in a tree topology. In case a station is lost due to cable problems or power loss we would like to identify where in the tree the problem occurs. Our code is all in BGCPLCs, so a solution using C language constructs is desirable. I have code that works: for (j=0; j<31; j++) { pshm->P[10] = j; Command ("L0 = P10"); Command ("P11 = ECAT[0].Slave[L0].Online"); if (! pshm->P[11]) { fault handling } } Unfortunately it is very compute intensive, ~600us to complete the loop. Given all the information gathering in Acontis, is there a PMAC variable or command that would immediately recognize and localize a station loss? We could probably approach this in a more hardware-oriented way: since all stations have a digital input terminal, one line could be made always active, so if it reads 0 a station outage would be indicated, but this would be a fallback solution. Thanks! John Quote Link to comment Share on other sites More sharing options...
steve.milici Posted December 29, 2022 Share Posted December 29, 2022 You may be able to identify a “gross” EtherCAT device “issue” in a PLC looking at one or more of the following elements and then run your BGCPLC to identify which slave is the offender: Motor[x].AmpFault ECAT[i].Error ECAT[i].LineCrossed ECAT[i].NotAllDevsOperational ECAT[i].RTDomainOutputState ECAT[i].Status[i] ;i=0-3 Quote Link to comment Share on other sites More sharing options...
jhenning Posted December 29, 2022 Author Share Posted December 29, 2022 Yes, using pshm->ECAT[0].NotAllDevsOperational to detect slave loss does make this PLC much more efficient (25% decrease in BG CPU usage) under normal conditions. if (pshm->ECAT[0].NotAllDevsOperational) { for (j=0; j<31; j++) { pshm->P[10] = j; Command ("L0 = P10"); Command ("P11 = ECAT[0].Slave[L0].Online"); if (! pshm->P[11]) { fault handling } } } Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.