5 — VEHICLE CONTROL LANGUAGE (VCL)
Curtis Model 1351 – December 2018
pg. 100
Configuration of a Receive Mailbox
function
Setup_CANopen_Receive_Mailbox()
Sets up the initial parameters for
a CANopen mailbox.
This CANopen specific function sets up the initial parameters for a CANopen
mailbox.
It serves the same purpose as the generic setup function, but simplifies the setup
for CANopen users.
This function MUST BE called before defining the data for the mailbox or trying
to use the mailbox.
syntax
Setup_CANopen_Receive_Mailbox(Handle,Messsge_type,Node_
ID,Mask,Service)
arguments:
Handle
The mailbox ID
Message type
NMT, SYNC, EMR, SDO_TX, SDO_RX, TPDO1-4,
RPDO1-4
Node ID
Node ID to include in the message
Mask
Set the bits in the 11 Bit ID that must match,
1 = must match,
0 = don’t care.
Default set to MATCH_ALL = 0x07FF … vs
RECEIVE_ALL = 0x0000
Service
HALT_ON_RECEPTION = the Mailbox will stop
receiving any more data until the buffer is read and
Cleared by command.
The Receive flag is set and counter = 1
OVERWRITE_ON_RECEPTION = the mailbox
will contain the last data, old data is lost.
The Receive flag is set and counter will increment
on each new reception
returns:
0
Mailbox not setup
1
Mailbox setup
reported errors:
Bad_ID
Handle out of Range
BAD_MO_ID
Message ID is NOT unique