Echelon LonTal Stack User Manual

Page 130

Advertising
background image

118

Developing a LonTalk Stack Device Application

To process notification of a network variable update, modify the

LonNvUpdateOccurred() event handler function (in the FtxlHandlers.c file)
to call the appropriate functions in your application. The API calls this function

with the index of the updated network variable. The following figure shows the
control flow for receiving a network variable update.

LonEventPump()

LonNvUpdateOccurred()

Host Processor

Application

LonTalk Protocol Stack

and API

Receive Network

Variable Update from

Network

Add “Update Received”

Event to Queue

nviCount

Update

Configuration network variables are used much in the same way as input
network variables, with the exception that the values must be kept in persistent

storage, and the application does not always respond to changes immediately.
Example 1, below, shows the processing flow for regular network variable

updates, and example 2 shows the same flow but with the addition of a

configuration network variable.

Example 1:
This example uses the same power converter model file from the example in the

previous section, Sending a Network Variable Update. That example
demonstrated how to read the network variable inputs asynchronously by

reading the latest values from the network variables declared in the FtxlDev.c
file.
This example extends the previous example and shows how your application can

be notified of an update to either network variable. To receive notification of a
network variable update, modify the LonNvUpdateOccurred() callback

function.

In FtxlHandlers.c:

Advertising