Danfoss MCO 305 Design Manual page 186

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

Advertisement

MCO 305 Design Guide
CAN Basic library
Raw Telegram mode
This library contains all the functions necessary to do raw CAN telegram transfer. So you can define
mailboxes with the commands DEFCANIN and DEFCANOUT for reading and writing telegrams. Those
commands allow the length and telegram id (standard 11 bit identifiers) to be chosen. Once defined, you
can use those mailboxes to receive and send those telegrams using the commands CANOUT and CANIN.
The CANIN command allows the user to use remote frames and to define if he wants to wait for an answer
or not. You can also define the time out for the reading.
The command CANDEL can be used to delete already defined mailboxes.
Command
Description
CANDEL
erases all or single
CAN objects
CANIN
reads an object
CANOUT
sends message
(active)
DEFCANIN
defines a receive
object
DEFCANOUT
defines a transmit
object in the CAN
controller
Buffered Message Transfer
This message transfer is used by APOSS. But if APOSS is not active, it could also be used for application
purposes. But you must be aware that buffered message handling expects that all telegrams are really read.
Otherwise, a full buffer can stop program execution because, for example, an OUTMSG has to wait until
buffer allows writing again.
There are three telegrams used for this sort of communication.
GlobalMessage
telegram ID = 0
RxMessage
telegram ID = CANNR * 2 + 1 8 Byte length
TxMessage
telegram ID = CANNR * 2
GlobalMessages are read by all controllers. The first two bytes may not be used by applications. These bytes
must always be 0 or you may have unwanted side effects.
186
__ How to Program __
Syntax
CANDEL objno
status = CANIN objno
timeout control varhi
varlo
CANOUT no valhi vallo
objno =
DEFCANIN id dlen
objno = DEFCANOUT id
dlen
8 Byte length
®
MG.33.L5.02 – VLT
is a registered Danfoss trademark
Parameter
objno = object number, which is returned during
object definition
= –1 deletes all objects (except standard objects)
objno = object number, which is returned during
object definition
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
valhi = bytes 0 to 3 of the CAN object data
vallo = Bytes 4 to 7 of the CAN object data
id = CAN-id
dlen = data length of the object in bytes (max.
8 bytes)
id = CAN-identification number
dlen = data length of the object in bytes (max.
8 bytes)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents