5 — VEHICLE CONTROL LANGUAGE (VCL)
pg. 91
Curtis Model 1351 – December 2018
SDO Management
Ten VCL functions are described here to manage Service Data Objects (SDOs)*. SDOs are used to
either read data from another device to send data to the device. In either case, the 1351 OS will send
an SDO and then wait for and buffer the return. The VCL needs only to poll the SDO buffer for the
response. Each SDO sent will be provided a Reception_ID. This ID is used to check the status of the
request and to pull the data from the input reception buffers. The buffer is 16 messages deep. Reading
from the buffer clears out that message.
function
Reception_ID = Request_SDO_Read()
Send an SDO read request to
a specific node
This function sends an expedited SDO request to read a value from a specific device
identified by its Node ID. The function will return a handle (i.e.,
Reception_ID
)
to the 1351’s receive buffer location where the data will be placed. Each buffer
location is 32 bits (4 bytes) wide.
The
Reception_ID
is used to check the status of the particular request and pulls
the data from the input reception buffers. Once a message is read, it is pulled from
the request buffer. The buffer is 16 messages deep. If a buffer is full, the Request
function will return an invalid ID of 0 (valid IDs are 1-16), meaning no more
messages can be requested until the pending messages (1-16) are checked and
pulled from the buffer, or the buffer is cleared.
When each request is made, an individual timer is started. If the timer expires, a
fault will be set. Checking the status of a timed out value will return a fault code
(see the error code table for
Check_SDO_Read
)
syntax
Request_SDO_Read (Port, Node_ID, Index, Sub-Index,
Timeout)
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
Index
The CANopen Index of the parameter to read
Sub-Index
The CANopen sub-Index of the parameter to read
Timeout
Specify the maximum time (in milliseconds) to
receive a response.
returns:
Reception_ID (i.e., the handle to check the status)
reported errors:
BAD_ID
Port# out of Range
* SDO Service Data Object (SDO). A SDO is a low priority message used to transfer data sets from a client to a server and vice
versa. Several types of data transfer are available, with the Client (master controller) taking the initiative for a transfer. The SDO
process is used primarily to read or write to an object index of a Server (slave controller).