Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

CANOpen slave and heartbeat

chab
2012-03-21
2012-04-13
  • chab - 2012-03-21

    Is the CANOpen slave (CanRemoteDevice) capable of transmitting Error Control Service (ECS) e.g. heartbeat?
    (I cannot find any cfg option to do that. See figure. I use CoDeSys V3.)

    Regards,
    Edwin.

    IMG: CanRemoteDevice_Heartbeat.JPG

     
  • spfeif - 2012-03-22

    What is the "Edit SDO parameter area"? If it is a slave then it is up to the Master to configure the heartbeat. It also looks like it is relying on an eds file. Check and see if the heartbeat is configured in the eds file.

     
  • chab - 2012-03-26

    In the "Edit SDO parameter area" user defined SDO can be created.
    The button generates / exports an eds file.

    In that eds file, the heartbeat entries are available:
    [1017] ParameterName=Producer Heartbeat Time
    [1016] ParameterName=Consumer Heartbeat Time
    Also Guard entries are available:
    [100C] ParameterName=guard time
    [100D] ParameterName=life time factor
    This gives an indication that the slave has heartbeat functionality.

    How can I activate the CANOpen device's heartbeat (without doing any SDO from the master)?

    Regards,
    Edwin.

     
  • spfeif - 2012-03-26

    Well if it is CANopen compliant it is up to the Master to configure it. But you may on the CANopen side have defaults. You may have to modify the EDS file to add default parameters. Maybe CoDeSys is using the defaults until it is changed by the master? The Slave will automatically boot up and send a heartbeat message for each state that it changes to , Bootup, Pre-op etc..

     
  • chab - 2012-03-28

    Thank you, spfeif, for your answer.

    In the generated eds file, the [1017] Producer Heartbeat Time equals 100.
    But when I read this entry, with SDO, on an actual device, it is 0. (The device is not using the default value!)

    After I wrote a value to the enty, with SDO, on an actual device, the device started with producing heartbeats. (That is a success.)

    Does this mean that I need a CANOpen master to cfg the device?

    I want the device to start with heartbeat on it's own, without any CANOpen master. Is there any work-around e.g. transmit the heartbeat manually, by a function block?

     
  • chab - 2012-03-30

    A nice work-around would be that the CANOpen slave enables it's own heartbeat.
    By using the CIA405.SDO_WRITE4 function, write a value in [1017] Producer Heartbeat.

     
  • chab - 2012-04-13

    I found a work-around.

    I’ll write a value directly in the driver, like this:
    pm_uiHeartbeatTime := ADR (CANObject.m_uiHeartbeatTime);
    pm_uiHeartbeatTime^ := 500;
    (It’s dirty and not maintainable but it works.)

    Regards,
    Edwin.

     

Log in to post a comment.