3.4. Hot Connect
The EC-Simulator supports Hot Connect. The initial presence of Hot Connect groups can be configured. If bConnectHcGroups is set, all Hot Connect groups will be initially connected, else only the mandatory SubDevices will be initially connected.
See also
HiL:
EC_T_SIMULATOR_INIT_PARMS::bConnectHcGroupsatesInitSimulator()SiL
EC_T_LINK_PARMS_SIMULATOR::bConnectHcGroupsat ecatInitMaster
3.4.1. Configured Station Alias
The network configuration contains the initial setting of the Configured Station Alias e.g. used by the MainDevice to identify Hot Connect Group Heads.
In order to change the Configured Station Alias after loading the configuration, the EEPROM must be updated and the SubDevice needs to be power cycled.
The following example demonstrates this:
Configured Station Alias Update Example
EC_T_WORD wSlaveAddress = 1001;
EC_T_WORD wAlias = 1234;
EC_T_WORD wEepromVal = EC_GET_FRM_WORD(&wAlias);
/* write new station alias to EEPROM */
dwRes = esWriteSlaveEEPRom(dwSimulatorId, EC_TRUE, wSlaveAddress, ESC_SII_REG_ALIASADDRESS, &wEepromVal, 1, EEPROM_TIMEOUT);
if (dwRes != EC_E_NOERROR)
{
goto Exit;
}
/* power cycle slave to apply station alias from ESC_SII_REG_ALIASADDRESS (EEPROM) to ECREG_STATION_ADDRESS_ALIAS (ESC register 0x0012) */
dwRes = esPowerSlave(dwSimulatorId, wSlaveAddress, EC_FALSE);
if (dwRes != EC_E_NOERROR)
{
goto Exit;
}
dwRes = esPowerSlave(dwSimulatorId, wSlaveAddress, EC_TRUE);
if (dwRes != EC_E_NOERROR)
{
goto Exit;
}