Skip to end of metadata
Go to start of metadata

This section describes the example applications for the Micrium OS CANopen stack. See Example Applications section for further information about how to enable an example application.

CANopen Module Initialization Example

Description

This example shows how to initialize the CANopen stack.

The CANopen module initialization example accomplishes the following tasks:

Configuration

No specific configuration applies to this example.

Location

  • /examples/canopen/ex_canopen.c
  • /examples/canopen/ex_canopen.h

API

APIDescription
Ex_CANopen_Init()This function performs the different example steps mentioned in the section Description. The function must be called by your application task prior to calling any other CANopen examples. 

CANopen Node Start Example

Description

This example shows how to start the CANopen node(s). It accomplishes the following tasks:

Configuration

No specific configuration applies to this example.

Location

  • /examples/canopen/ex_canopen.c
  • /examples/canopen/ex_canopen.h

API

APIDescription
Ex_CANopen_NodeStart()This function performs the example steps mentioned in the section Description. The function must be called by your application task prior to calling any other CANopen examples and after calling the initialization example. 

CANopen Object Dictionary Read/Write Example

Description

This example shows how to perform read and write operations with the CANopen Object Dictionary. It accomplishes the following tasks:

  • It reads the value of an object at index 0x1017 (CANopen Producer Heartbeat Time) and shows it on the console.
  • It writes a new value for this object entry.
  • It reads again the value of object 0x1017 and shows it on the console to confirm that the write operation is successful.
  • It sends a Node Reset message and reads again the value of object 0x1017 to show that it has come back to its default value.
    • It also demonstrates how the Parameter Groups and the callbacks structure work to reload parameters from a non-volatile memory. Refer to page Communication Objects Callbacks Usage for more details about the available callbacks.

Configuration

No specific configuration applies to this example.

Location

  • /examples/canopen/ex_canopen.c
  • /examples/canopen/ex_canopen.h

API

APIDescription
Ex_CANopen_DictRdWrReset()This function performs the example steps mentioned in the section Description.