Danfoss MCO 305 Design Manual page 188

Programmable motion controller
Hide thumbs Also See for MCO 305:
Table of Contents

Advertisement

MCO 305 Design Guide
CANopen Master library
This library has functions to support the usage of CANopen Slaves like I/O modules or encoders or even
drives. Those functions do not only allow the configuration with SDOs but do allow the usage of process
data through PDOs.
Functions SDOREAD and SDOWRITE are used to read or write the object dictionary of any slave. Even an
SDOREADSEG and SDOREADSEGP is supported which allows segmented reads (either unpacked or packed)
to be done.
Those commands allow the user to configure and command CAN slaves on the bus. So the user could, for
example, set another drive into a special mode or start the drive with a given speed (if the drive has a CAN
option).
To allow easy usage of external I/O over CAN bus, the normal IN and OUT commands are extended. If you
specify a number bigger than 256, then automatically a CAN I/O is assumed. So by using the command
OUT 257 1 you can set the output number 1 on the CAN I/O module with the Node ID 1.
The output number equals (node_Id * 256 + output_no). The same is true for INAD and OUTDA. So any
kind of analogue input and output modules can also be used.
Furthermore, you have the possibility to register a CANopen module with the command CANINI. Doing this,
the module is automatically guarded in the background. This also makes the IO traffic faster and you can
even use an ON INT for a CANopen input.
The following commands and parameters realize master functionality:
Command
Description
CANIN (>100)
Gathers all Transmit-PDOs
of digital input modules or
CAN drive status by using
only one CAN telegram.
CANINI,
Initializes the necessary
objects (PDOs) for data
exchange of CANopen
nodes, or enables extended
CANINI, CANIN function.
SDOREAD
Reads SDO of a connected
CANopen device.
SDOREADSEG
Segmented read of SDOs
(unpacked).
188
__ How to Program __
Syntax
result = CANIN (id *
100) timeout control
varhi varlo
CANINI no, no, ...,
CANINI 999
CANINI no, 999, ...
val = SDOREAD id
index sub
res = SDOREADSEG id,
index, subindex,
arrayname
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark
Parameter
id = CAN id
timeout =
-1 = no wait for data
0 = waits until data arrives
>0 = waits for data in timeout
control =
0 = copies new arrived data to the
variables
1 = sends a remote frame and waits for
data in dependence on timeout
varhi = bytes 0 to 3 of the CAN object data
varlo = bytes 4 to 7 of the CAN object data
no = guard * (busoffset * 1000 + id)
guard = -1, +1 (without / with guarding)
busoffset = 100000 , 0 (slave bus,
master bus)
id = CAN id (1...127)
-id = executes the command without
waiting for the answer
index = index of object
sub = sub index (0x00 – 0xFF)
id = CAN id number
-id = executes the command without
waiting for the answer
index = 0x2000
subindex = parameter number
arrayname = name of a existing array

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents