Specifications

16 Softing
16-18
CAN-AC2 and CANopen devices
Introduction
xPC Target CAN-AC2 supports CAN specification 2.0a and 2.0b but this does
not generally include the CANopen protocol on driver level. Nevertheless it is
possible to access CANopen devices by the CAN-AC2 drivers in a general way.
CANopen knows two types of messages ie. SDO and PDO. SDO’s are used to
setup or initialize a CANopen device for a certain behavior. PDO’s are
messages which contain real-time data (ie. converted A/D values from a analog
input device) and are just regular CAN-type messages with no CANopen object,
index and subindex information.
xPC Target application which have to access CANopen devices over the
CAN-AC2 drivers transmit SDO’s during the initialization phase and the
termination phase of the driver. PDO’s are sent or received during the
simulation phase of the driver.
Because SDO’s and PDO’s are regular CAN-messages the CAN-AC2 drivers
just have to provide a way to transmit SDO’s during the initialization and
termination phase of the CAN-AC2 setup driver block to initialize the different
CANopen devices in the network. This is done by providing a c-file within your
project directory which describes the SDO messages to send to setup and
terminate the CANopen device. During the compilation stage of the xPC Target
application (build-process) this c-file which has to have the file name
CANAC2_setup.c is then included into the setup driver.
This implementation has the advantage of accessing a specific CANopen device
without the need to have special driver blocks for this device. It is therefore a
general implementation but has on the other hand the disadvantage that the
user must be able to provide the information (messages) to properly setup and
terminate the communication with a specific CANopen device. This
information is provided either by the CANopen device manufacturer or by the
CAN-CIA association (www.can-cia.de).
To explain how to write the CANAC2_setup.c file for a specific CANopen device
an example is shown below. In this example an analog input device from
Selectron (www.selectron.ch) with name AIC711 is used to get the A/
D-converted values over the CAN-network into the xPC Target application.