5 — VEHICLE CONTROL LANGUAGE (VCL)
pg. 107
Curtis Model 1351 – December 2018
Example Transmit SRDO Setup
The example below assumes the variables have been setup previously for the mailbox handles, Node
IDs and message data. After this set up, the main loop of VCL must call the
Send_SRDO(SRDO_
XMT_Handle)
command to cause the 1351 to send the two linked SRDO messages.
Note that only the Primary port mailbox Data is defined. In an SRDO transmit, the Supervisor will
use the same data definition as the Primary, but will invert the data when sent from the Supervisor.
; ==================== SETUP SRDO Transmit =============
; Set the CAN cross connect parameter ON by CSS or the 1313MH
; Setup two mailbox, one is for primary (first message), another is for supervisor (inverted data/second message)
Primary_Mailbox = assign_can_mailbox(CAN_PORT_1, C_XMT);
Supervisor_Mailbox = assign_can_mailbox(CAN_PORT_2, C_XMT);
; Configure the two mailboxes as the SRDO type
setup_canopen_transmit_mailbox(Primary_Mailbox, SRDO, SRDO_FIRST_MESSAGE_ID, 0)
setup_canopen_transmit_mailbox(Supervisor_Mailbox, SRDO, SRDO_SECOND_MESSAGE_ID, 0)
; Configure mailbox data
define_canopen_transmit_data(Primary_Mailbox, SRDO_XMT_Data_1, 0, 8)
define_canopen_transmit_data(Primary_Mailbox, SRDO_XMT_Data_2, 0, 8)
define_canopen_transmit_data(Primary_Mailbox, SRDO_XMT_Data_3, 0, 8)
define_canopen_transmit_data(Primary_Mailbox, SRDO_XMT_Data_4, 0, 8)
; Setup SRDO to event driven with a 20mS interval between first and second messages
SRDO_XMT_Handle = Setup_transmit_SRDO(Primary_Mailbox, Supervisor_Mailbox, 0, 20)
; Enable SRDO
; Enable_transmit_mailbox(Primary_Mailbox)
; Enable_transmit_mailbox(Supervisor_Mailbox)
; Enable_Transmit_SRDO(SRDO_XMT_Handle)
; ======================================================