CANopen Manager; Change the HeartbeatRatio

chab
2014-10-21
2014-11-03
  • chab - 2014-10-21

    Hi all,

    The CANopen manager / master has the ability to monitor CANopen slaves: "heartbeat consumer".
    The "heartbeat consumer time" equals "HeartbeatRatio" times (x) the "heartbeat producer time".

    In the file "CANopen_Manager_*.devdesc.xml", the "HeartbeatRatio" is set to 150 [%].

    <Parameter ParameterId="275" type="std:WORD">
    Β  Β  <Attributes download="false" offlineaccess="readwrite" onlineaccess="readwrite" />
    Β  Β  <Default>150</Default>
    Β  Β  <Name name="localStrings:HeartbeatRatio">Default slave ratio for heartbeat time in percent</Name>
    </Parameter>
    

    My CANopen master misses some heartbeats sometimes.
    (The CAN log shows the heartbeat message was on the bus. But the master did not process it (in time, or at all). And re-initializes the CANopen slave.)

    I would like to use a HeartbeatRatio of 250 [%]. In my application, the CANopen master is "allowed" to miss one heartbeat.
    (With a HeartbeatRatio of 150 [%], the CANopen master is "allowed" to receive the heartbeat later. But the CANopen master has to receive it!)

    After changing the HeartbeatRatio to 250 [%], in the "CANopen_Manager_*.devdesc.xml" file, and making a new application from scratch,
    the observed HeartbeatRatio is 150 [%] still!

    Does anyone have experience with:
    - CANopen master "missing" some heartbeats sometimes.
    - Changing the HeartbeatRatio of the CANopen master.

    Regards,
    Edwin.

     
  • eschwellinger

    eschwellinger - 2014-10-21

    Hi Edwin,

    I would recommend to solve the problem ->
    not to workaround this issue with some kind of settings, you need to solve the root cause of the problem.

    Is it possible to test your interface /CAN implementation by the hopefully well know 'CAN Echo' project?
    You need to figure out how stable your CL2 works according loosing can messages even on high bus load situations.

    Even more there is a very good feature in 3.5SP5 you could activate CANOPEN_DEBUG in the Application compile options
    which then give more debug messages in the plc log, a really great improvemt to find CAN problems.

    BR
    E.Schwellinger

    IMG: DebugLogger.jpg

    IMG: CANOPEN_DEBUGSP5.jpg

     
  • chab - 2014-11-03

    I found the problem.
    The CL2 function ResetBusAlarm has the side effect that some CAN messages are lost.

    eError := _3SCOS.CL2.ResetBusAlarm (hDriver := hDriver);
    

    I restricted the calls to ResetBusAlarm.

    IF (all slaves, that the master manages, are not operational) THEN
    Β  Β  eError := _3SCOS.CL2.ResetBusAlarm (hDriver := hDriver);
    END_IF
    

    Thank you,
    Edwin.

     

Log in to post a comment.