Model file – Echelon LonTal Stack User Manual

Page 226

Advertising
background image

214

Appendix G: Appendix G


Example LonTalk

Stack Applications

The myEventReady() function calls the OSAL OsalSetEvent() function to

signal the application task so that it can process the network event.

The myEventReady() function is shown below.

/* This function is called by the FTXL LonEventReady
* callback, signaling that an event is ready to be
* processed.
*/
void myEventReady(void) {
/* Signal application task so that it can process the

* event. */

OsalSetEvent(eventReadyHandle);
}

Model File

The model files for the SimpleLtDevice and SimpleIp852Device example
application define the L

ON

W

ORKS

interface for the example LonTalk Stack

devices.

The model file defines one functional block, VoltActuator. The VoltActuator

functional block includes two network variables, nviVolt and nvoVoltFb. The

functionality for these network variables is implemented in the
myNvUpdateOccurred() function described in Event Handler Function.
The model file is shown below.

#pragma enable_sd_nv_names

network input SNVT_volt nviVolt;
network output SNVT_volt bind_info(unackd) nvoVoltFb;

fblock SFPTclosedLoopActuator {

nviVolt implements nviValue;

nvoVoltFb implements nvoValueFb;

} VoltActuator
external_name("VoltActuator");

For more information about creating and using a model file, see Creating a Model

File.

Extending the SimpleLtDevice and SimpleIp852
Examples

You can configure the L

ON

W

ORKS

interface and functionality of the

SimpleLtDevice and SimpleIp852 example applications. To do this, perform

the following steps:

1. Copy the files in the Examples\SimpleDevice directory to your

project’s directory. This ensures that you have a backup of the examples’

original source files.

2. Clear the read-only flag for each of the copied files.
3. Modify the device interface by adding network variables to the Simple

Example.nc model file.

Advertising