5 — VEHICLE CONTROL LANGUAGE (VCL)
pg. 89
Return to TOC Curtis Model 1351 – December 2018
Error_Index = Check_CANopen_Emergency() Checks for message
on port & device
Check if there was an emergency message active on this port and slave device.
If the Node ID = GLOBAL (0) than any emergency message will be found.
Note, this “Error_Index” example is a variable name chosen by the VCL writer
that is set equal to the function in order to identify the emergency message by the
slave Node ID. e term “Error_Index” is used here to indicate how to use this
function in VCL (“Error_Index” it can be any VCL appropriate variable name).
Check_CANopen_Emergency(Port, Node_ID)
:
Port_1 = CAN1 e primary CAN port, pins 3 & 4
Port_2 = CAN2 e secondary CAN port, pins 5 & 6
Node_ID e Slave Node ID or Global for all slave nodes
:
0 = no Emergency Messages
1 or greater = the number of messages buered for that Node ID,
(Basically, the length of the buer is returned)
:
Status = Get_CANopen_Emergency_Message() Full 8 bytes of the
message, and ID
Returns the rst 8 bytes of an emergency message and Node_ID and places them
into the following pre-dened VCL variable(s) as illustrated, as Status. e buer is
16 messages, e.g., Status_01 through Status_16. ese are the messages as indexed
by “Error_Index”, described above.
Get_CANopen_Emergency_Message(Error_Index)
:
Each call to the function will re-ll these variables.
Or, specify the VCL variable, Status (as illustrated here), with the
“Error-Index” argument.
:
Emergency_Message_Error_Code (bytes 0 and 1)
Emergency_Message_Error_Register (byte 2)
Emergency_Message_Data_1 (byte 3)
Emergency_Message_Data_2 (byte 4)
Emergency_Message_Data_3 (byte 5)
Emergency_Message_Data_4 (byte 6)
Emergency_Message_Data_5 (byte 7)
Emergency_Message_Node_ID 0 = if the buffer
is empty at the
specified location
: