ECATCommErrors
Description
This function block returns a list of bad EtherCATEtherCAT is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT was to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs connections. If EtherCAT network communication is shutdown, the failed connections are based on information that was taken at the time the network was shutdown.
Figure 7-186: ECATCommErrors function block
Define | Port |
---|---|
#define EC_PORT_A | 0 (* Port A *) |
#define EC_PORT_B | 1 (* Port B *) |
#define EC_PORT_C | 2 (* Port C *) |
#define EC_PORT_D | 3 (* Port D*) |
Arguments
Input
Execute | Description | Read the communication errors on the rising edgeA rising edge is the transition of a digital signal from low to high. It is also called positive edge |
Data type | BOOL | |
Range | 0,1 | |
Unit | n/a | |
Default | — | |
Connection |
Description | Array of bad connections. The safe size for the list is [2 * (number of devices) - 1 ]. |
Data type | ECATCommErr_ref (see ECATCommErr_ref Structure table above) | |
Range | N= 0 to 2 times the number of EtherCAT devices. | |
Unit | n/a | |
Default | — |
Output
Done | Description | Indicates when the function is complete |
Data type | BOOL | |
Unit | n/a | |
Error |
Description | Indicates the function failed due to an error. |
Data type | BOOL | |
Unit | n/a | |
ErrorID | Description | The function call error result, if Error is TRUE (see Possible Error Codes and Descriptions table below). Upon success, Error is set to zero.. |
Data type | DINT | |
Unit | n/a | |
ConnectionCount | Description | The number of bad connections. Valid indices in the Connection array range from zero to ConnectionCount -1 (assuming that ConnectionCount != 0). |
Data type | UINT | |
Unit | n/a |
Error Code | Description |
---|---|
ECERR_DEVICE_ERROR | The EtherCAT driver is in a bad state |
ECERR_INVALID_ARRAY_SIZE | The size of the Connections is too small |
-
- When the array size is smaller than the number of bad connections, the array is filled with the data to the extent of the size of the array and the error ‘ECERR_INVALID_ARRAY_SIZE’ is also set. In this scenario, the output ConnectionCount is set to the size of the array and it is smaller than the number of actual bad connections.
Related Functions
Example
-
- See Checking the Connections for Errors: in the EtherCAT Communication Diagnosis Steps section of the Troubleshooting chapter for an example of implementing this function.
Structured Text
(********************************************************)
Read EtherCAT communication errors.
(********************************************************)
commErrors( TRUE, Connection);
FBD
FFLD