I cannot receive EMCY objects in my application but the CODESYS IDE does receive them I can see it in the status window of the device, so EMCY is of course enabled. I have the following program:
EMCY_INFO : CIA405.EMCY_ERROR;
IF EMCY_NW.ERRORINFO.EMCY_ERROR_CODE <> 0 THEN
xReq_EMCY:=FALSE; //Here I have a breakpoint but it never catches anything
Why do I not receive any EMCY messages in my application? I us PDO and do SDO_write without any problems.
You need to first trigger the function with its input "enable". Then you can use the output "ERRORINFO.EMCY_ERROR_CODE".
In your example code the "ERRORINFO.EMCY_ERROR_CODE" will stay 0 because it is the initial value and the function is not executed.
You can have a look into the example project "CANopen example" from CODESYS Store.
Log in to post a comment.