HotConnect, Repair, and Restart

In this section, we describe how HotConnect, Repair, and Restart work and we provide a few cases.

HotConnect

HotConnect is the process of adding hardware using extra EtherCAT-enabled ports, such as Ethernet (ports on T-junctions and couplers), eBUS (connectors on couplers), and M12 (round connectors on waterproof devices). This way, new devices can be added without interrupting the operation of existing hardware. You can add hardware in the beginning or among devices. However, adding a device in the beginning requires the EtherCAT connection to be restarted, as you need to unplug the cable connected to the computer and all devices will be offline, unless you use cable redundancy. Interrupting other devices is not the purpose of HotConnect. Typically, new hardware is added at the end or among devices. Because KINGSTAR uses indexes (SlaveIds) to sort devices, new hardware is always put at the end of the EtherCAT slave array, and its index is incremented from the last existing device.

Function: EnableHotConnect

When enabled, you can add new hardware while an EtherCAT network is running. When disabled, you need to add hardware when it is stopped.

The diagram below illustrates the relationship between a device's SlaveId and its position on an EtherCAT network. When the EtherCAT network starts, connected devices are arranged sequentially according to their physical connection order. The device connected directly to the master is recognized as the first device. The master then assign SlaveIds (slave indexes) in sequence, which corresponds to the EtherCAT slave array. Initially, SlaveIds align with physical positions, e.g., SlaveId 0 to Position 0, SlaveId 1 to Position 1, and so on.

However, when devices are added or removed while the EtherCAT network is in the Operational (Op) state, their positions on the network may change, but their indexes remain the same. Newly added devices are appended to the end of the EtherCAT slave array in sequence. As a result, a device's position and index may no longer align. Please refer to the following use cases for more details.

NOTE:  This behavior applies only to physical slaves. There is no simulated slaves in KINGSTAR.

Use case 1

Adding a device when HotConnect is enabled

In this scenario, four Slaves (A, B, C, and D) are connected to the EtherCAT network. If we insert Slave E between Slave A and B, and Slave F between Slave B and C, the master assigns SlaveId 4 and SlaveId 5 to Slave E and F, respectively. Although the physical positions of Slave B, C, and D shift, their SlaveIds remain unchanged.

Removing a device when HotConnect is enabled

Continuing from the above case, if we remove Slave E from the EtherCAT network, the physical positions of the slaves connected after Slave E will change, but their SlaveIds will remain unchanged.

Reconnecting a device to a different position when HotConnect is enabled

Continuing from the above case, if we reconnect Slave E at a different position (Position 4), its index will still be SlaveId 4, as the master recognizes it as the same device with the same Vendor ID and Product Code.

Use case 2

HotConnect is enabled. There are four servo drives and we want to add two additional drives between the third and fourth. We have a T-junction, so we can add the drives using extra Ethernet ports. In KINGSTAR, the indexes of the newly added devices are four and five (indexes are zero-based), and the new drives appear at the end of the EtherCAT slave list.

Repair

The feature replaces a broken hardware or cable with a new one while all other devices — and the EtherCAT network — are running, and it repairs the EtherCAT state of the new device to Operational (Op). You must use the same model to replace the old one, because EtherCAT applies the old model's settings to the new model. If you have a model that has the same Vendor ID and Product Code as the old one, and is compatible with the old one's settings, you can use it.

Function: EnableAutoRepair

When enabled, the EtherCAT states of the new device and all the hardware behind it will be changed to Op automatically. When disabled, their states will be Init, and you will need to change them to Op manually. To manually change the state, use RequestSlaveState.

Use case

AutoRepair is enabled. There are five servo drives and we want to replace the third one. We unplug the cable between the second and the third. The hardware from the third to the final drive are offline. We replace the third with a same model and plug the cable back in. The EtherCAT states of the third and all the devices behind it are Init at first, and then proceed to Op.

Repair + HotConnect

Repair is used to replace a device with the same model, which must have the same Vendor ID and Product Code. HotConnect is used to add new devices. If the Vendor ID or Product Code of the new device is different from the previous one, HotConnect is used. When they are the same, Repair is used.

Use case

AutoRepair and HotConnect are enabled. There are five servo drives and we want to add two between the third and fourth. We don't have a T-junction or coupler, so we have to unplug the cable connecting the third and fourth. The fourth and fifth are offline. We connect the two drives and plug all the cables back in. All the offline drives are online and their states are changed to Op.

In this case, the original fourth and fifth drives use AutoRepair because they are the same models. The two new drives use HotConnect.

Restart

As the name implies, it restarts the EtherCAT master when the cable connected to the computer is unplugged and then plugged back in.

Function: EnableAutoRestart

When enabled, the EtherCAT master is restarted automatically when the cable is plugged back in. When disabled, it won't be restarted automatically. To manually start or restart them, use Start or Restart.

Use case

AutoRestart is enabled. There are five devices and the cable connected to the computer is loose. We plug it back in and all the devices are restarted.

Start and Restart

Start scans the devices on an EtherCAT network while Restart doesn't. Because of this, Start is slower than Restart. If you have added new hardware without HotConnect, you need to use Start.

See also

RT and Win32 – KINGSTAR Fieldbus - Subsystem configuration

EnableHotConnect

EnableAutoRepair

EnableAutoRestart

RT and Win32 – KINGSTAR Fieldbus - Subsystem control

Start

Restart

.NET API – Api Class - Subsystem configuration

Api.EnableHotConnect

Api.EnableAutoRepair

Api.EnableAutoRestart

.NET API – Api Class - Subsystem control

Api.Start

Api.Restart

.NET Class – ISubsystem Interface - Methods

ISubsystem.Start

ISubsystem.Restart

.NET Class – ISubsystem Interface - Properties

ISubsystem.HotConnect

ISubsystem.AutoRepair

ISubsystem.AutoRestart