Isiimplementationversion() – Echelon ISI User Manual

Page 133

Advertising
background image

131

ISI Programmer’s Guide

selector, and rejects the open enrollment message if insufficient network variable

aliases are available to meet that assumption:

unsigned IsiGetAssembly(const CsmoData* pCsmo, boolean Auto) {
unsigned candidateAssembly;
// Determine an eligible assembly based on local knowledge and
// inspection of data provided with pCsmo and Auto arguments
candidateAssembly = …
return IsiGetFreeAliasCount() >= pCsmo->Width ?
candidateAssembly : ISI_NO_ASSEMBLY;
}

Example 2:
This example illustrates how a connection host can verify that sufficient local
resources are available using IsiGetFreeAliasCount (), prior to opening

enrollment:

void myValidatedOpenEnrollment (unsigned assembly) {
if (IsiGetFreeAliasCount (assembly) >= IsiGetWidth (assembly)) {
IsiOpenEnrollment (assembly) ;
}
}

This example assumes each network variable that is part of the connection
requires a network variable alias. The assumption ignores that some of the

network variables may not require an alias because they are not enrolled in a

connection, and ignores advanced connection schemes that use network variable
selector or network variable sharing. This is a worst-case assumption.

Typical applications may have better knowledge of the resource requirements,
and will often be able to provide a more efficient resource validation step. For

example,say you have an application that always uses IsiCreateEnrollment() and
never calls IsiExtendEnrollment() for the assembly in question. That application

never needs to validate available aliases for this assembly. Or, an application

that only implements a single assembly may find more efficient ways to ensure
the availability of sufficient network variable aliases.

IsiImplementationVersion()

unsigned IsiImplementationVersion(void);

Returns the version number of this ISI implementation, which is 3 for the

Release 3 and Release 3.01 ISI libraries. No forwarder is provided for the
IsiImplementationVersion() function. This function operates in any state of the

ISI engine.

Advertising