CANopen

CANopen devices can be detected while KINGSTAR is scanning the bus. Scanning the CANopen bus takes 30 seconds to 1 minute. If a CANopen coupler is connected, KINGSTAR needs an additional 30 seconds to 1 minute to start.

There are three ways to set up CANopen devices:

  1. Use default settings. After the CANopen devices are detected, KINGSTAR will receive the PDO settings from them. It then applies these settings to the system. This method has the lowest priority and is only applicable to simple I/O modules.
  2. Import the CANopen settings to the KINGSTAR database. KINGSTAR uses these settings after it has started. Currently, users aren't allowed to import CANopen settings by themselves. It has to be done by the KINGSTAR team.
  3. Use AddModuleConfiguration to configure your own CANopen device. You need to use the CanOpenSetting structure to set your device and send it to KINGSTAR. When using AddModuleConfiguration, the device ID is the CAN ID of the device. This method has the highest priority.

CANopen devices may have their own object dictionary. In this case you can access objects using the AoeReadCommand and AoeWriteCommand commands. The port parameter to use for the AoE commands is 0x1000 + CAN ID. For example, a device with CAN ID 7 uses port 0x1007.

If you use the ReadIOSdoObject and WriteIOSdoObject commands, they will automatically call AoE commands and apply the correct port number.

NOTE:  Currently, all CANopen modules are regarded as I/O modules. The only supported CANopen coupler is Beckhoff EL6751.

Edit baud in CANopen

KINGSTAR uses 500 Kb for CAN bus scanning and communication. Baud is editable in Beckhoff EL6751.

To edit the baud, call AddModuleConfiguration with ModuleId set to zero. In the CanOpenSetting structure passed to Configuration, add an SDO command for the object 0xF800:2 with the value corresponding to the chosen baud. The baud values can be found in the EL6751 user guide.

See also

RT/Win32 – KINGSTAR Fieldbus - Mailbox

AoeReadCommand

AoeReadSdoObject

AoeReadWriteCommand

AoeWriteCommand

AoeWriteControlCommand

AoeWriteSdoObject

.NET API – Api Class - Mailbox

AoeReadCommand

AoeReadSdoObject

AoeReadWriteCommand

AoeWriteCommand

AoeWriteControlCommand

AoeWriteSdoObject

.NET Class – ISlave Interface - Methods

AoeReadCommand

AoeReadSdoObject

AoeReadWriteCommand

AoeWriteCommand

AoeWriteControlCommand

AoeWriteSdoObject

PLC function blocks – EtherCAT

EC_ReadAxisInfo

EC_ReadByteParameter

EC_ReadDWordParameter

EC_ReadModuleInfo

EC_ReadStringParameter

EC_ReadWordParameter

EC_RestartModule

EC_WriteByteParameter

EC_WriteDWordParameter

EC_WriteStringParameter

EC_WriteWordParameter