CANopen errors on slave Codesys 3.5, CAA

zack
2022-07-12
2022-07-21
  • zack - 2022-07-12

    Hello,

    I'm trying to make use of the CAA library to detect specific can errors locally on a CANopen slave. On paper this should work:

    //Set temp node
    IF _itfNode = 0 THEN
        _itfNode := DED.GetRoot();
    END_IF
    
    //Iterate till the only CANbus node is found
    IF NOT CANbusNodeFound THEN
        _itfBus := DED.INode_TO_IBus(_itfNode);
        //Check if the CANbus has been able to cast
        IF  _itfBus <> 0 THEN
            CANbusNodeFound := TRUE;
        ELSE
            _itfNode := DED.GetNextNode(_itfNode);
        END_IF
    ELSE
        GetCANopenBusError( itfNode := _itfRootNode, einBusError => CANopenBusError);
    END_IF
    

    But the itfRootNode is null and checking if itfRootNode is root returns FALSE. Confused, I tried to quickly list nodes with

    nodes : ARRAY [0..12] OF DED.INODE;
    

    But they're all null. Which is weird since changing the number of nodes before compiling requires an array size change. Has anyone had a similar problem? Using a safety PLC (CR710s) with the standard application selected.

    I'd be very thankful for any kind of pointers =).

     
  • zack - 2022-07-21

    Got the nodes to show up by ticking off "Enabling diagnosis for devices", restarting the application and rebuilding.

     
  • zack - 2022-07-21

    Got the nodes to show up by ticking off "Enabling diagnosis for devices", restarting the application and rebuilding.

     

Log in to post a comment.