Function block CIA405.RECV_EMCY checks if an emergency object has been received from any DEVICE.
Output:
CONFIRM |
BOOL |
see CIA405.CIA405BASE |
ERROR |
CIA405.CANOPEN_ KERNEL_ERROR |
see CIA405.CIA405BASE |
DEVICE |
CIA405.DEVICE |
Additional device information connected to STATE; 0 means local device range: 0 … 127 initial: 0 |
ERRORINFO |
CIA405.EMCY_ERROR |
EMCY code |
CIA405.RECV_EMCY will check if an emergency object (/DS-301/) has been received from any device. If the function block has finished its action without any error, output CONFIRM is changed to TRUE and ERROR to 0. ERRORINFO contains the information about the received emergency and DEVICE is set to the ID of the device sending the emergency object. An emergency was received if both DEVICE and error code of ERRORINFO are unequal 0.
If an error occurred while checking for an emergency, CONFIRM is set to FALSE and ERROR is set to the corresponding error value.
Recommendation: In order to deliver all pending EMCY messages with each call of the function block in a loop and also to notify a "Reset Error"- EMCY at least once, a lower level software may work in the way, that for each device a storage for the received EMCY messages is managed as described in the recommendation for ⇘ CIA405.RECV_EMCY_DEV (FB) . The function block CIA405.RECV_EMCY scans the EMCY storages in a loop over all existing devices. If a device is found during the scan, for which the EMCY-storage contains an EMCY different from "No Error", the EMCY is delivered. Else if a device is found, for which an EMCY different from "No Error" was delivered at the last scan and for which the EMCY-storage now contains "No Error", this "No Error"-EMCY is delivered. Each device, for which a "No Error" was delivered at last, is skipped during the scan, that is a "No Error"-EMCY is delivered only once. On the next execution the search is continued. In order to get the information that a pending EMCY was cleared by receiving "Reset Error" from a device, this "Reset Error"- EMCY is delivered only once, i.e. DEVICE > 0 while ERRORINFO = 0. In order to get the information that all devices are error-free, the function block delivers DEVICE = 0 and ERRORINFO = 0 after a complete scan over the EMCY-storages of all existing devices.