Network variable configuration table, Example model files, Simple network variable declarations – Echelon LonTal Stack User Manual

Page 88: Network variables using standard types

Advertising
background image

76

Creating a Model File

Network Variable Configuration Table

This table contains one entry for each network variable that is declared in the

model file. Each element of a network variable array counts separately.

The maximum size of the network variable configuration table is 4096 entries.

You cannot change the size of this table, except by adding or deleting static

network variables or by increasing or decreasing the number of dynamic network
variables.

Example Model files

This section describes a few example model files, with increasing levels of

complexity.

See Network Variable and Configuration Property Declarations for information

about mapping types and items declared in the model file to those shown in the
LonTalk Interface Developer utility-generated application framework.

Simple Network Variable Declarations

This example declares one input network variable and one output network

variable. Both network variables are declared with the SNVT_count type. The
names of the network variables (nviCount and nvoCount) are arbitrary.

However, it is a common practice to use the “nvi” prefix for input network
variables and the "nvo" prefix for output network variables.

network input SNVT_count

nviCount;

network output SNVT_count

nvoCount;

The LonTalk Interface Developer utility compiles this model file into an
application framework that contains, among other things, two global C variables

in the FtxlDev.c file:

volatile SNVT_count nviCount;
SNVT_count nvoCount;

When an update occurs for the input network variable (nviCount), the LonTalk
host stack stores the updated value in the global variable. The application can

use this variable like any other C variable. When the application needs to update

the output value, it updates the nvoCount variable, so that the LonTalk Host
stack can read the updated value and send it to the network.
For more information about how the LonTalk Interface Developer
utility-generated framework represents network variables, see Using Types.
Important: This example is not interoperable because it does not use functional

blocks to define the purpose of these network variables. However, this type of
declaration can define a functioning device for an initial test application.

Network Variables Using Standard Types

A more complete example includes the use of more complex standard network

variable types and declarations. This example provides the model for a simple
electricity meter, where all input data is retrieved from the network through the

nviAmpere, nviVolt, and nviCosPhi input network variables. The result is

Advertising