Echelon LonTal Stack User Manual
Page 112
100
Using the LonTalk Interface Developer Utility
Network Variable and Configuration Property
Declarations
The LonTalk Interface Developer utility generates network variables and
configuration properties using the built-in types defined in LonPlatform.h along
with the types defined in LonNvTypes.h and LonCpTypes.h. Both network
variables and configuration properties are declared in the FtxlDev.c file, where
input network variables (including configuration network variables) appear as
volatile variables of the relevant type, and configuration properties that are not
implemented with network variables appear as members of configuration files.
Example:
A model file contains the following Neuron C declarations:
SCPTlocation cp_family cpLocation;
network input SNVT_obj_request nviNodeRequest;
network output polled SNVT_obj_status nvoNodeStatus;
const network output polled SNVT_address nvoFileDir;
fblock SFPTnodeObject {
nviNodeRequest implements nviRequest;
nvoNodeStatus
implements
nvoStatus;
nvoFileDir
implements nvoFileDirectory;
} NodeObject external_name("NodeObject") fb_properties {
cpLocation
};
The LonTalk Interface Developer utility generates the following variables in the
FtxlDev.c file for the nviNodeRequest, nvoNodeStatus, and nvoFileDir
network variables:
volatile SNVT_obj_request nviNodeRequest;
SNVT_obj_status nvoNodeStatus;
SNVT_address nvoFileDir = {
LON_DMF_WINDOW_START/256u, LON_DMF_WINDOW_START%256u
};
The LonTalk API, upon receipt of an incoming network variable update,
automatically moves data into the corresponding input network variable and
signals this event by calling an event handler function, which allows your
application to respond to the arrival of new network variable data. Your
application then reads the input variable to obtain the latest value.
To send an update to the nvoNodeStatus output network variable, your
application writes the new value to the nvoNodeStatus variable, and then calls
the LonPropagateNv() function to propagate the new value onto the network.
See Chapter 8, Developing a LonTalk Stack Device Application, for information
about the development of a LonTalk Stack application using the LonTalk
Interface Developer utility-generated code.
The utility generates the following configuration file in FtxlDev.c for the
cpLocation configuration property:
/*
*
* Writable configuration parameter value file