Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The send function may be used within the application to transmit additional messages on the CANopen interface. The following example show how to call the transmit function for the interface of the CANopen node AppNode:


Code Block
languagecpp
    CO_IF_FRM   frame;
    CPU_INT16S  err;
    :
    frame.Identifier = 0x123;
    frame.DLC        = 8;
    frame.Data[0]    = 0x12;
    frame.Data[1]    = 0x23;
    frame.Data[2]    = 0x34;
    frame.Data[3]    = 0x45;
    frame.Data[4]    = 0x56;
    frame.Data[5]    = 0x67;
    frame.Data[6]    = 0x78;
    frame.Data[7]    = 0x89;
    err = COIfSend (&(AppNode.If), &frame);
    if (err < 0) {
        /* error in interface layer */
    }
    :


Note: Be careful with transmitting additional messages on an active CANopen network. This might result in unpredictable behavior of the complete system.

...