8-80 Trio BASIC Commands
System Parameters and Commands
Trio Motion Technology
In addition to using the
CAN
command to control CAN channels, Trio is introducing
specific protocol functions into the system software. These functions are dedicated
software modules which interface to particular devices. The built-in CAN channel
will automatically scan for Trio I/O modules if the system parameter
CANIO_ADDRESS is set to its default value of 32.
The Motion Coordinator CAN hardware uses the Siemens 81C91 CAN interface chip.
This chip can be programmed at a register level using the
CAN
command if neces-
sary. To program in this way it is necessary to obtain a copy of the chip data sheet.
The
CAN
command provides access to 10 separate functions:
CAN(channel#,function#,...)
Channel:
Channel
Number:
Maximum
Baudrate:
Built-in CAN
-1 500 KHz
Daughter Slot 0
01 Mhz
Daughter Slot 1
11 Mhz
Daughter Slot 2
21 Mhz
Daughter Slot 3
31 Mhz
Channel#
The channel number is in the range -1 to 3 and specifies the hardware channel
Function #:
There are 10 CAN functions 0..9:
0 Read 81C91 Register:
val=CAN(channel#,0,register#)
1Write 81C91 Register:
CAN(channel#,1,register#,value#)
2 Initialise Baudrate:
CAN(channel#,2,baudrate)
3 Check if msg received
val=CAN(channel#,3,message#)
4 Set transmit request
CAN(channel#,4,message#)
5 Initialise message
CAN(channel#,5,message#,identifier,
length)
6 Read message
CAN(channel#,6,message#,variable#)
7 Write message
CAN(channel#,7,message#,byte0,byte1..)