5 — VEHICLE CONTROL LANGUAGE (VCL)
pg. 89
Curtis Model 1351 – December 2018
function
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. The 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).
syntax
Check_CANopen_Emergency(Port, Node_ID)
arguments:
Port_1 = CAN1
The primary CAN port, pins 3 & 4
Port_2 = CAN2
The secondary CAN port, pins 5 & 6
Node_ID
The Slave Node ID or Global for all slave nodes
returns:
0 =
no Emergency Messages
1 or greater =
the number of messages buffered for that Node ID,
(Basically, the length of the buffer is returned)
reported errors:
function
Status = Get_CANopen_Emergency_Message()
Full 8 bytes of the
message, and ID
Returns the first 8 bytes of an emergency message and Node_ID and places them
into the following pre-defined VCL variable(s) as illustrated, as Status. The buffer is
16 messages, e.g.,
Status_01
through
Status_16
. These are the messages as indexed
by “Error_Index”, described above.
syntax
Get_CANopen_Emergency_Message(Error_Index)
arguments:
Each call to the function will re-fill these variables.
Or, specify the VCL variable, Status (as illustrated here), with the
“Error-Index” argument.
returns:
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
reported errors: