Lns and internet information services – Echelon LNS User Manual
Page 336
LNS Programmer's Guide
322
Echelon strongly recommends the exclusive use of early binding techniques. Note that
LNS director applications may have to use late binding strategies when accessing LNS
plug-in software. See the Implementing an LNS Director Application section on page 280
for more information on this.
The shorthand using a combined subsystem path such as “Shared Devices.Alarm” as
shown in the above example is supported directly by the LcaSubsystems object. Echelon
recommends using a complete subsystem path when known, as opposed to iterating
several levels of Subsystem objects. Using a subsystem path leads to shorter and faster
code, with reduced risk of programming error.
Finally, another frequently used line safer is the use of default properties. While not
supported by all development tools, Visual Basic is a popular example of a development
tool supporting default properties. While not recommended (as detailed above), the
single-line expression to obtain the Buzzer device could be further abbreviated by
removing the Item properties. The following example will, although not being
recommended, still compile and execute correctly.
Set MyBuzzer = MySystem.Subsystems(“Shared _
Devices.Alarms”).AppDevices(“Buzzer”)
The Item properties could be removed because this particular property is flagged as the
default for the object, and will be automatically queried if no property or method name is
explicitly given. Echelon does not recommend using default properties in the interest of
source code maintenance. Future developers of your LNS application will have to know
about default properties, and which property has the default flag for each particular LNS
object, in order to efficiently maintain and enhance the source code. Explicitly stating the
correct type, property or method names will make your application’s code more self-
explanatory and easier to maintain.
LNS and Internet Information Services
When using Microsoft’s Internet Information Services (IIS) to connect to an LNS
network, there are several things you should consider. Because IIS serves HTTP pages,
and HTTP is a stateless protocol, IIS will completely disconnect from the LNS Server
after every page is served. This means that the LNS Server must close and restart for
each LNS function call you make, which would cause each operation to take a
considerable amount of time. As a result, you should use the LNS Server application to
provide remote access to the network, and then use a Lightweight client application to
perform all operations on the network. By using the LNS Server application to provide
remote access to the network, the requirement to connect and reconnect to the LNS
Server is eliminated, and replaced by a quick socket connection. This will greatly
improve the performance of your application. In addition, this method allows you to run
IIS and the LNS Server application on different machines.