Servosila-SC-25-Programming-Guide

Introduction
Servosila SC-25 Brushless Motor Controllers provide an a CANopen control interface, and an
open USB 2.0 interface, a virtual COM port, for receiving commands from a control
computer/PLC as well as for sending telemetry back.
No proprietary drivers or SDKs are needed to connect the Servosila controllers to a Linux or a
Windows 10/8 computer. Both Windows 10/8 and Linux come with prepackaged drivers and
programming APIs sufficient to interface to Servosila controllers; this includes the popular Linux
distributions of Debian and Ubuntu. Drivers for Windows 7 are available on request.
The controllers feature a built-in USB-to-CAN routing function, a “built-in USB2CAN
adapter/dongle”, that enables PCs/PLCs to access an entire CAN network through connection to
a single Servosila controller via its USB port. In other words, by connecting to a USB port of a
single Servosila controller, a control computer/PLC gains access to the entire CANbus network
to which the Servosila controller is connected to. Up to 16 controllers chained via their CANbus
ports can be controlled by the same PC/PLC using the built-in USB-to-CANbus routing function.
The limit is mainly due to throughput of a USB port of the SERVOSILA controller that acts as a
USB2CAN dongle in addition to driving a motor; otherwise, all devices on a CANbus network
are equally accessible to a control computer/PLC via a connection to a single Servosila
controller. This includes non-Servosila devices such as GPS receivers or IMUs.
Up to 126 Servosila controllers can be connected to the same CANbus instance if a control
computer/PLC has a hardware CANbus interface or a dedicated USB2CAN adapter. Linux
SocketCAN API can be used to develop software that sends commands to Servosila controllers
or receives telemetry back from the controllers.
Whenever a USB 2.0 interface (vs. a CANbus interface) is used to connect Servosila controllers
to a Linux or a Windows 10/8 computer, the controllers appear as Virtual COM ports to both
operating systems. A semi-standard text protocol called SLCAN is then used to send commands
to the controllers through the virtual COM port as well as for receiving telemetry back.
In addition, most Linux distributions come with a special SLCANd daemon which makes
Servosila controllers attached via USB Virtual COM ports appear as CANbus devices or as
USB2CAN dongles. This daemon makes it possible to use the same Linux SocketCAN API
whenever the Servosila controllers are connected to Linux via USB 2.0 or a CANbus interface
(does not matter which one, the API is still SocketCAN API).
As Windows 10/8 systems do not have such a unified CANbus API, the ways for a control
system’s software running on Windows to interact with Servosila controllers include:
either through a virtual COM-port (USB 2.0) by writing to and reading from the port
using a standard text protocol called SLCAN which is based on exchange of text strings
formatted according to fairly simple open specification,
or using a third-party USB2CAN adapter/dongle, and whatever programming API the
adapter/dongle provides for Windows.
4 www.servosila.com