Implementing a scptnwrkcnfg cp – Echelon ISI User Manual
Page 52
ISI Programmer’s Guide
50
Implementing a SCPTnwrkCnfg CP
ISI applications must implement a SCPTnwrkCnfg configuration property that is
implemented as a configuration network variable. This configuration property
must apply to your application’s Node Object, if available, or apply to the entire
device if there is no Node Object. This configuration property provides an
interface for network tools to disable self-installation on an ISI device. This
allows for the same device to be used in both self-installed and managed
networks. The cp_info(reset_required) attribute is typically used with the
declaration of the SCPTnwrkCnfg CP. This allows you to simply check the
current ISI state in the device’s when (reset) task. See the ISI example
applications for examples.
The default value of the SCPTnwrkCnfg configuration property must be
CFG_EXTERNAL. This allows for the device to be transitioned to a managed
network without error. When setting this as the default for a device that will use
self-installation, detect the first start with a new application image and, in this
case only, change the value of the CP to CFG_LOCAL so that the ISI engine can
come up running with the first power-up
.
E
XAMPLE
network input SCPTnwrkCnfg cp cp_info(reset_required) cpNetConfig
= CFG_EXTERNAL;
device_properties {
cpNetConfig
};
eeprom SCPTnwrkCnfg oldNetConfig = CFG_NUL;
when (reset) {
SCPTnwrkCnfg
netConfig;
netConfig = oldNetConfig;
if (netConfig == CFG_NUL) {
// First application start, enable self-installation
cpNetConfig
=
CFG_LOCAL;
}
oldNetConfig = cpNetConfig;
if (cpNetConfig == CFG_LOCAL) {
if (netConfig == CFG_EXTERNAL) {
// Managed application has returned to self-installation
IsiReturnToFactoryDefaults(); // Call NEVER returns!
}
// Self-installed network--start the ISI engine
scaled_delay(31745UL);
// 800ms delay
IsiStartS(isiFlagExtended);
}
}