beautypg.com

Echelon ISI User Manual

Page 61

background image

59

ISI Programmer’s Guide

To enable debugging with the managed environment provided by the

NodeBuilder and LonMaker tools, you must ensure that an ISI application in
development cannot modify the primary domain. The primary domain and the

device’s network address are managed by the NodeBuilder tool; modifying this

data as a result of self-installation will prevent testing and diagnosing with the
NodeBuilder or LonMaker tools.

To prevent the primary domain from being overridden when using the
NodeBuilder tool, override the IsiSetDomain() function with one that does
nothing, for a debug target as shown in the following example:


#ifndef _MINIKIT
#ifdef _DEBUG
void IsiSetDomain(domain_struct* pDomain, unsigned Index) {
;
}
#endif
#endif

The ISI engine will call this function whenever the primary domain must be

updated. The default implementation routes this call to the update_domain()
standard Neuron C library function. With an override as shown here, an attempt

to update the primary domain has no effect.

WARNING

: The IsiSetDomain() override shown here will disable important

aspects of the ISI implementation. This override cannot be used with production-
level devices, or devices that are to be used outside the managed NodeBuilder

environment.

When using the IsiSetDomain() override in the above fashion to allow for

development, testing, and debugging of ISI-related code of a self-installed device
within a managed NodeBuilder environment, a few other restrictions exist:

The LonMaker Browser will not work with self-installed devices when the ISI
engine is running. While monitoring network variable values may work
correctly, updating network variable values may not work.

In a typical ISI application, the SCPTnwrkCnfg configuration property must be
set to CFG_LOCAL to enable the ISI code. If it is not, then the ISI engine will be

disabled. In the debug environment, you can force the ISI engine to always be
running, bypassing the SCPTnwrkCnfg CP setting. The following example shows

how to do this:

network input cp SCPTnwrkCnfg nciNetConfig = CFG_LOCAL;

when (reset) {

#ifndef _DEBUG
if (cpNetConfig == CFG_LOCAL)
#endif
{
scaled_delay(31745UL);

// 800ms delay

IsiStartS();

}
} // when (reset)

The development network may contain other managed devices. However,

managed and self-installed connections cannot coexist within the same domain