Echelon i.LON SmartServer 2.0 User Manual

Browse online or download User Manual for Sensors Echelon i.LON SmartServer 2.0. Echelon i.LON SmartServer 2.0 User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 266
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews

Summary of Contents

Page 1 - SmartServer 2.0

078-0349-01D®i.LON®SmartServer 2.0 Programming Tools User’s Guide

Page 2

x Preface ○ A sample license generator configuration file (an XML file named iLONLicenseGenValuesSample.xml) that demonstrates the structure of the

Page 3 - Table of Contents

86 Creating Freely Programmable Modules void CUFPTHVACController::Shutdown() { m_oTimer1.Stop(); StopAllTimers(); } See the Programmer’s Ref

Page 4

i.LON SmartServer 2.0 Programming Tools User’s Guide 87 Line1.SetDpProperty(FPM::Dp::cfgUCPTpersist, bValue); //write data point poll rate in mill

Page 5

88 Creating Freely Programmable Modules FPM and the devices connected to the RS-232 and RS-485 serial interfaces, read data from the RS-232 or RS-

Page 6

i.LON SmartServer 2.0 Programming Tools User’s Guide 89 Compiling an FPM Once you finish writing an FPM, you can compile it with the i.LON SmartSe

Page 7

90 Creating Freely Programmable Modules Once you correct all the compile errors and the warnings, click File and then Save to re-compile your code

Page 8 - Preface

i.LON SmartServer 2.0 Programming Tools User’s Guide 91 2. In the Text File Encoding box, click Other and then select UTF-8 from the bottom of t

Page 9

92 Creating Freely Programmable Modules debug configuration of your FPM in the i.LON SmartServer 2.0 Programming Tool and upload it to your SmartSe

Page 10 - SmartServer Requirements

i.LON SmartServer 2.0 Programming Tools User’s Guide 93 • To reboot your SmartServer using the SmartServer console application, enter the reboot

Page 11 - Related Reading

94 Creating Freely Programmable Modules c. This dialog lists the build configurations available for your FPM. If the Debug 4.03 configuration is

Page 12 - Content

i.LON SmartServer 2.0 Programming Tools User’s Guide 95 h. Click OK to return to the C/C++ Projects view. 6. Set the Debug 4.03 or Debug confi

Page 13

i.LON SmartServer 2.0 Programming Tools User’s Guide xi Web site at www.echelon.com/products/cis/activate. To run Echelon first-party FPMs or thi

Page 14

96 Creating Freely Programmable Modules 8. Upload the debug configuration of your FPM to your SmartServer. To do this, expand the Debug 4.03 or D

Page 15 - Introduction

i.LON SmartServer 2.0 Programming Tools User’s Guide 97 c. The New Connection dialog opens. In the Connection Type window, select the WindRiver

Page 16 - Creating and Deploying FPMs

98 Creating Freely Programmable Modules d. In the Target Server Options window, enter the IP address or hostname of the SmartServer on which the F

Page 17

i.LON SmartServer 2.0 Programming Tools User’s Guide 99 b. The Load/Add Symbols to Debug Server dialog opens. In the Symbol Files and Order box

Page 18

100 Creating Freely Programmable Modules c. Click OK. The symbols in your FPM are now loaded in the Target Manager view. Symbol icons should app

Page 19

i.LON SmartServer 2.0 Programming Tools User’s Guide 101 d. If you are using the iLonSystemWdbEnd image and want to switch to System Mode, right

Page 20 - Quick-Start FPM Exercise

102 Creating Freely Programmable Modules • Add your user help functions to the UFPT<FPM>_Utils.cpp file (this file is created when you creat

Page 21

i.LON SmartServer 2.0 Programming Tools User’s Guide 103 • Math. This FPM application adds two SNVT_count input data points when one of the data

Page 22

104 Creating Freely Programmable Modules

Page 23

i.LON SmartServer 2.0 Programming Tools User’s Guide 105 6 Deploying FPMs on a SmartServer This chapter describes how to use the i.LON SmartServe

Page 24

xii Preface • Neuron C Programmer’s Guide. Describes how to write programs using the Neuron® C Version 2.1 language. • Neuron C Reference Guide.

Page 25

106 Deploying Freely Programmable Modules on a SmartServer FPM Deployment Overview After you write and compile an FPM application or driver, you can

Page 26

i.LON SmartServer 2.0 Programming Tools User’s Guide 107 • An FPM programming license must be installed on your SmartServer in order for an FPM t

Page 27

108 Deploying Freely Programmable Modules on a SmartServer 4. The Install FPM Module dialog opens with the Deployment Settings window.

Page 28 - 14 Introduction

i.LON SmartServer 2.0 Programming Tools User’s Guide 109 5. Enter the following properties: FTP Settings Host Enter the IP address or hostname

Page 29

110 Deploying Freely Programmable Modules on a SmartServer 7. This window lists the tasks to be performed, which consists of uploading the FPM to

Page 30

i.LON SmartServer 2.0 Programming Tools User’s Guide 111 To order an FPM programming license for your SmartServer, go to the i.LON SmartServer 2.

Page 31

112 Deploying Freely Programmable Modules on a SmartServer Selecting a Network Management Service Before you create your FPM devices on the SmartSe

Page 32

i.LON SmartServer 2.0 Programming Tools User’s Guide 113 2. Install the Echelon Enterprise Services 2.0 (EES 2.0) and LNS Server Service Pack 5 o

Page 33

114 Deploying Freely Programmable Modules on a SmartServer If you are using the SmartServer in Standalone mode and your internal FPM devices are usi

Page 34

i.LON SmartServer 2.0 Programming Tools User’s Guide 115 3. The Create Device dialog opens. 4. In the Name property, enter a meaningful name f

Page 35

i.LON SmartServer 2.0 Programming Tools User’s Guide xiii For More Information and Technical Support The i.LON SmartServer 2.0 Programming Tools R

Page 36

116 Deploying Freely Programmable Modules on a SmartServer 7. Click OK. An internal device representing your FPM application is added to the bott

Page 37 - Programming Tools

i.LON SmartServer 2.0 Programming Tools User’s Guide 117 Using a Dynamic Device Interface If you are running your network with the SmartServer ope

Page 38

118 Deploying Freely Programmable Modules on a SmartServer 7. The Add Functional Block dialog opens. 8. In the Name property, enter a name for t

Page 39

i.LON SmartServer 2.0 Programming Tools User’s Guide 119 10. Click OK. 11. Click Submit. A functional block representing the FPM application

Page 40

120 Deploying Freely Programmable Modules on a SmartServer Commissioning FPM Devices If you are running your LONWORKS network in LNS mode (LNS Auto

Page 41

i.LON SmartServer 2.0 Programming Tools User’s Guide 121 2. Follow the instructions in the Commission Device Wizard and then click Finish. See

Page 42

122 Deploying Freely Programmable Modules on a SmartServer Testing FPM Applications After you add an FPM application on the SmartServer, you can tes

Page 43

i.LON SmartServer 2.0 Programming Tools User’s Guide 123 The major difference between LONWORKS connections and Web connections is that LONWORKS co

Page 44 - Importing FPM Projects

124 Deploying Freely Programmable Modules on a SmartServer 5. The Configure – WebBinder Web page opens and the hostname of the LNS Server and the

Page 45

i.LON SmartServer 2.0 Programming Tools User’s Guide 125 7. References to the target LONWORKS network variables ( ) are added underneath the hub

Page 46

xiv Preface Region Languages Supported Contact Information China Chinese English Echelon Greater China Rm. 1007-1008, IBM Tower Pacific Century P

Page 47

126 Deploying Freely Programmable Modules on a SmartServer See Chapter 5 of the i.LON SmartServer 2.0 User’s Guide for more information on selectin

Page 48

i.LON SmartServer 2.0 Programming Tools User’s Guide 127 Note: For more information on creating LONWORKS connections with the LNS tree, including

Page 49

128 Deploying Freely Programmable Modules on a SmartServer To create Web connections with the data points declared in your FPM application, follow t

Page 50

i.LON SmartServer 2.0 Programming Tools User’s Guide 129 c. In the tree of the target SmartServer, right-click the any object in the network bra

Page 51

130 Deploying Freely Programmable Modules on a SmartServer e. Click Submit. 3. From the local SmartServer tree on the left frame, right-click a

Page 52

i.LON SmartServer 2.0 Programming Tools User’s Guide 131 5. From the Webbinder Destinations tree on the right frame, expand the SmartServer Webb

Page 53

132 Deploying Freely Programmable Modules on a SmartServer 6. Click Submit. References to the target data points are added underneath the source d

Page 54

i.LON SmartServer 2.0 Programming Tools User’s Guide 133 Note: For more information on using Web connections, including how to validate, delete,

Page 55 - Creating FPM Templates

134 Deploying Freely Programmable Modules on a SmartServer If an .htm file for your FPM application is not in the folder, use the i.LON Development

Page 56

i.LON SmartServer 2.0 Programming Tools User’s Guide 135 The NLS Text object is used to translate custom SmartServer Web pages into multiple lang

Page 57

i.LON SmartServer 2.0 Programming Tools User’s Guide 1 1 Introduction This chapter provides an overview of freely programmable modules (FPMs) and

Page 58

136 Deploying Freely Programmable Modules on a SmartServer 9. Specify the data point to be monitored and controlled by the i.LON Vision 2.0 object

Page 59

i.LON SmartServer 2.0 Programming Tools User’s Guide 137 10. Configure the other object properties in the dialog following the i.LON Vision 2.0

Page 60

138 Deploying Freely Programmable Modules on a SmartServer 13. Click Publish on the Editor toolbar (), click File and then click Publish, or click

Page 61

i.LON SmartServer 2.0 Programming Tools User’s Guide 139 2. Upload your company’s updated resource file set to the root/LonWorks /types/User/<

Page 62

140 Deploying Freely Programmable Modules on a SmartServer 5. Select the XIF file to be activated, following these steps: a. In the Template prop

Page 63

i.LON SmartServer 2.0 Programming Tools User’s Guide 141 d. Click OK to return to the Setup - LON Device Driver Web page. e. Click Submit.

Page 64

142 Deploying Freely Programmable Modules on a SmartServer 8. If you switched a static device interface to a dynamic interface, add a functional b

Page 65

i.LON SmartServer 2.0 Programming Tools User’s Guide 143 • If you are deploying an FPM application that uses static functional blocks, copy the d

Page 66

144 Deploying Freely Programmable Modules on a SmartServer

Page 67

i.LON SmartServer 2.0 Programming Tools User’s Guide 145 7 Creating FPM Application Licenses This chapter describes how to create licenses for yo

Page 68

2 Introduction Overview of Freely Programmable Modules Freely Programmable Modules (FPMs) are custom C/C++ applications and drivers that you can use

Page 69

146 Creating FPM Application Licenses Licensing Overview You can create FPM application licenses and let customers order and implement your FPMs on

Page 70 - Creating a Model File

i.LON SmartServer 2.0 Programming Tools User’s Guide 147 demonstrates the structure of the <PredefinedFeatures> element and the properties y

Page 71

148 Creating FPM Application Licenses indexes. LicenseType Specify the type of license to be issued. The default LicenseType is “Unlimited”. You

Page 72 - Declaring Functional Blocks

i.LON SmartServer 2.0 Programming Tools User’s Guide 149 Creating a Security DLL File The i.LON License Generator requires a security DLL file nam

Page 73 - Example Model Files

150 Creating FPM Application Licenses the C macro DONT_TRANSLATE_NAMES before each of these files. The names of the routines to be used all begin w

Page 74

i.LON SmartServer 2.0 Programming Tools User’s Guide 151 To verify that the license key in the FPM license file is valid, your license validation

Page 75

152 Creating FPM Application Licenses Tips for Securing your Licensing Scheme: You can implement a number of security measures in your licensing sc

Page 76 - Saving your Model File

i.LON SmartServer 2.0 Programming Tools User’s Guide 153 3. Click the header file. The header file view opens to the right of the C/C++ Projects

Page 77

154 Creating FPM Application Licenses 2. Insert code similar to the following somewhere after the FPM constructor: // flag defining whether FPM

Page 78 - Other Command Switches

i.LON SmartServer 2.0 Programming Tools User’s Guide 155 Tips: • You should obscure the name of the license validation routine (and other symb

Page 79 - Creating FPMs

i.LON SmartServer 2.0 Programming Tools User’s Guide 3 You can create up to 10 internal FPM devices on the SmartServer. Each internal FPM device

Page 80 - Creating FPMs Overview

156 Creating FPM Application Licenses Step 4: Writing the License Validation Algorithm You need to write a license validation algorithm that (1) ve

Page 81 - Creating New FPM Projects

i.LON SmartServer 2.0 Programming Tools User’s Guide 157 Generator Configuration File for more information on the CompanyName and FeatureName prop

Page 82 - Creating an FPM

158 Creating FPM Application Licenses Verifying the License Key To write your license validation algorithm so that it verifies the license key in t

Page 83

i.LON SmartServer 2.0 Programming Tools User’s Guide 159 Note: Pointers to strings will not be NULL if they are not used, instead some may point

Page 84

160 Creating FPM Application Licenses char msg[100]; sprintf(msg, "FPM license key is invalid: file \"%s\"\n", taskCal

Page 85

i.LON SmartServer 2.0 Programming Tools User’s Guide 161 set path=%path%;C:\LonWorks\iLON\Development\eclipse\plugins\ com.echelon.eclipse.ilon100

Page 86

162 Creating FPM Application Licenses 2. By default, the first pre-defined feature specified in the license configuration file (iLONLicenseGenVal

Page 87

i.LON SmartServer 2.0 Programming Tools User’s Guide 163 • To locate the LUID (Neuron ID) from the SmartServer Web pages, click Driver at the top

Page 88

164 Creating FPM Application Licenses The FPM application license log file lists the following information: • The date on which the FPM applicat

Page 89 - Using UFPT Local Variables

i.LON SmartServer 2.0 Programming Tools User’s Guide 165 LonWorks\iLON\Development\eclipse\workspace.fpm\<company program ID>.UFPT<FPT Na

Page 90 - Writing an FPM Application

4 Introduction You can move your mouse pointer over an object in your FPM to open a tooltip that provides a description and the API of the selected

Page 91 - Using the Start() Method

166 Creating FPM Application Licenses

Page 92

i.LON SmartServer 2.0 Programming Tools User’s Guide 167 8 Localizing the SmartServer Web Interface This chapter describes how to translate cus

Page 93

168 Localizing the SmartServer Web Interface Language Localization Overview You can localize the language of the SmartServer Web interface using th

Page 94

i.LON SmartServer 2.0 Programming Tools User’s Guide 169 b. Paste the folder in the same directory. c. Rename the folder to something meanin

Page 95 - Reading Scalar Data Points

170 Localizing the SmartServer Web Interface 5. Expand the General folder, click Existing Projects into Workspace, and then click Next. The Impo

Page 96

i.LON SmartServer 2.0 Programming Tools User’s Guide 171 7. Browse to the LonWorks\iLon100\images\iLon100 4.0<x> <Language> folder

Page 97 - Writing Data Point Values

172 Localizing the SmartServer Web Interface 9. Expand the NLS folder. All the English, German, and French .properties files for the SmartServe

Page 98

i.LON SmartServer 2.0 Programming Tools User’s Guide 173 8000010128000000[4].UFPTscheduler.properties files in the root/web/nls/echelon/ folder wi

Page 99

174 Localizing the SmartServer Web Interface 3. The left frame in the view lists all the common properties in the SmartServer Web interface. The

Page 100 - Writing an FPM Driver

i.LON SmartServer 2.0 Programming Tools User’s Guide 175 6. The Lang. and Country properties are filled in. Optionally, you can enter a Variant

Page 101

i.LON SmartServer 2.0 Programming Tools User’s Guide 5 iLonSystemWbdEnd image on your SmartServer to iLonSystem, reboot the SmartServer, create a

Page 102 - {

176 Localizing the SmartServer Web Interface 8. A new COMMON<_language[_REGION] [_variant]>.properties file is added to the C/C++ Projects

Page 103 - Compiling an FPM

i.LON SmartServer 2.0 Programming Tools User’s Guide 177 You can comment out the text in a translation by selecting the checkbox () in the upper

Page 104 - Using Non-Latin Characters

178 Localizing the SmartServer Web Interface a. Browse to the LonWorks\iLon100\images\iLon100 4.0<x> <Language>\web\nls\echelon direct

Page 105 - Debugging FPMs

i.LON SmartServer 2.0 Programming Tools User’s Guide 179 2. Re-name the copy by deleting the “Copy of” pre-fix and inserting the “<_language[

Page 106 - Using Wind River Workbench

180 Localizing the SmartServer Web Interface 2. Connect i.LON Vision 2.0 to your SmartServer. To do this, click Manage Connections in the Sites p

Page 107

i.LON SmartServer 2.0 Programming Tools User’s Guide 181 8. The iLON Vision -Object – <Application> dialog opens. 9. Configure the applic

Page 108

182 Localizing the SmartServer Web Interface 12. In the File Name property, enter the name of the .htm file (one word with no spaces), and then cl

Page 109

i.LON SmartServer 2.0 Programming Tools User’s Guide 183 5. Click Browse. The Browse to Folder dialog opens. 6. Browse to the web/config/Fb/N

Page 110

184 Localizing the SmartServer Web Interface 7. Click Finish. A web-config-Fb (custom NLS) project appears in the C/C++ Projects view. 8. Expa

Page 111

i.LON SmartServer 2.0 Programming Tools User’s Guide 185 Localizing the Language of the SmartServer Web Interface Localizing the language of the S

Page 112

ii Preface Echelon, i.LON, LON, LONWORKS, LonTalk, Neuron, LONMARK, 3120, 3150, LNS, LonMaker, and the Echelon logo are trademarks of Echelon Corpora

Page 113

6 Introduction just re-name the sample DLL file LicenseSecurity.dll; however, you are solely responsible for the creation of the security DLL file.

Page 114

186 Localizing the SmartServer Web Interface To create a new web/user/echelon/<language[_REGION] [_variant]> folder, follow these steps: 1.

Page 115

i.LON SmartServer 2.0 Programming Tools User’s Guide 187 4. Save the index.htm file. 5. Copy the index.htm file to the SmartServer. To do thi

Page 116 - Using SNMP Support

188 Localizing the SmartServer Web Interface opens. Click New Site, the Edit Site dialog opens. Enter your SmartServer’s information, and then cli

Page 117

i.LON SmartServer 2.0 Programming Tools User’s Guide 189 a. In the Page Title box, enter a descriptive page title. b. Click OK. 8. Click Pu

Page 118

190 Localizing the SmartServer Web Interface • Line 8 corresponds to the “i.LON SmartServer 2.0 – Welcome” title at the top of the SmartServer We

Page 119 - ONWORKS network. It

i.LON SmartServer 2.0 Programming Tools User’s Guide 191 Translating the Menu.htm File You can translate the Welcome.htm and Menu.htm files in the

Page 120 - FPM Deployment Overview

192 Localizing the SmartServer Web Interface 6. Click Edit on the Editor toolbar () or click the Layout tab. 7. Double-click the Menu bar and

Page 121

i.LON SmartServer 2.0 Programming Tools User’s Guide 193 8. Expand SETUP to display its submenu items.

Page 122

194 Localizing the SmartServer Web Interface 9. Click Edit. The Navigation Subtree dialog opens. 10. In the Label box, translate SETUP to you

Page 123

i.LON SmartServer 2.0 Programming Tools User’s Guide 195 13. When you have finished translating the menus and menu items to your localized langua

Page 124

i.LON SmartServer 2.0 Programming Tools User’s Guide 7 Note: An FPM programming license must be installed on your SmartServer for the FPM to run

Page 125 - Deploying FPM Drivers

196 Localizing the SmartServer Web Interface c. Repeat steps a–b to change the language of the Back button to your localized language. 15. Click

Page 126 - ONWORKS

i.LON SmartServer 2.0 Programming Tools User’s Guide 197 • Lines 32–44 in this example correspond to the “Setup” menu and its menu items. • Li

Page 127

198 Localizing the SmartServer Web Interface • Lines 85–93 in this example correspond to the “Settings”, “Help”, and “Log Off” menus. Note that t

Page 128 - ONWORKS channel, and then

i.LON SmartServer 2.0 Programming Tools User’s Guide 199 2. Connect i.LON Vision 2.0 to your SmartServer. To do this, click Manage Connections i

Page 129

200 Localizing the SmartServer Web Interface 6. Double-click the Menu bar and the top of the Web page, or right-click the Menu bar and click Objec

Page 130

i.LON SmartServer 2.0 Programming Tools User’s Guide 201 1. Browse to the LonWorks\iLon100\images\iLon100 4.0<x> <Language>\web\user\

Page 131

202 Localizing the SmartServer Web Interface 3. Click Login. The localized i.LON SmartServer 2.0 - Welcome Web page opens. 4. The menus, the

Page 132

i.LON SmartServer 2.0 Programming Tools User’s Guide 203 Appendix A FPM Programmer’s Reference This appendix details the files, routines and m

Page 133

204 Appendix A - Programmer’s Reference Overview This chapter provides details you will need when programming your module. It includes the followi

Page 134 - Commissioning FPM Devices

i.LON SmartServer 2.0 Programming Tools User’s Guide 205 Initialize() The Initialize() routine in the .cpp file is called when your FPM applicatio

Page 135 - Recommissioning FPM Devices

8 Introduction e. In the channel (TT) field of the Program ID box, enter 04 if you have an FT-10 model of the SmartServer or enter 10 if you have a

Page 136 - Connecting FPM Data Points

206 Appendix A - Programmer’s Reference For an FPM application, you can also use the Work() routine to start and stop timers, and you can use it to

Page 137 - ONWORKS Connections

i.LON SmartServer 2.0 Programming Tools User’s Guide 207 For an FPM application, you can also use the OnTimer() routine to start and stop timers,

Page 138

208 Appendix A - Programmer’s Reference Shutdown() The Shutdown() routine in the .cpp file is called when your FPM stops or is disabled. You can

Page 139

i.LON SmartServer 2.0 Programming Tools User’s Guide 209 Variable Type Size unsigned long 32 Bits long 32 Bits unsigned int 32 Bits int 32 Bits

Page 140

210 Appendix A - Programmer’s Reference { Note: You can use the NotifyOnAllUpdates() method modify so that the Changed()method checks whether any

Page 141 - Creating Web Connections

i.LON SmartServer 2.0 Programming Tools User’s Guide 211 Note: You can also use temporary data point variables to write values to the fields with

Page 142

212 Appendix A - Programmer’s Reference If the priority specified in the nPrioAuthority parameter is equal to or higher than the priority currentl

Page 143

i.LON SmartServer 2.0 Programming Tools User’s Guide 213 This method returns the UCPTname configuration property of the data point in the followin

Page 144

214 Appendix A - Programmer’s Reference SYNTAX const timespec GetDpPropertyAsTimeSpec(FPM::Dp::dataUCPTlastupdate) This method returns the UCPTlast

Page 145

i.LON SmartServer 2.0 Programming Tools User’s Guide 215 AL_FIR_MONITOR_COND =20 AL_FIR_MAINT_ALERT =21 AL_FATAL_ERROR =30 AL_ERROR =31

Page 146

i.LON SmartServer 2.0 Programming Tools User’s Guide 9 fblock UFPTMath { in1 implements in1; in2 implements in2; out1 implements out1; } fbM

Page 147

216 Appendix A - Programmer’s Reference void SetDpProperty(FPM::Dp::dataUCPTAliasName, const char* const pszValue) The pszValue parameter specifie

Page 148

i.LON SmartServer 2.0 Programming Tools User’s Guide 217 EXAMPLE F1.SetDpProperty(FPM::Dp::cfgUCPTdefOutput, 100); SetDpProperty(persist) You can

Page 149

218 Appendix A - Programmer’s Reference External SmartServer Data Point Methods In an FPM application, you can use the List() method with a specifi

Page 150

i.LON SmartServer 2.0 Programming Tools User’s Guide 219 v.GetDpPropertyAsString(Dp::cfgUCPTname), v.GetDpPropertyAsString(Dp::cfgUCPTaliasName),

Page 151

220 Appendix A - Programmer’s Reference • -1. The data point value is read from the SmartServer’s internal data server. The poll rate used by t

Page 152 - Updating FPMs

i.LON SmartServer 2.0 Programming Tools User’s Guide 221 The pbyValue parameter specifies the value to be written to the data point. The STATUS va

Page 153 - Updating Device Interfaces

222 Appendix A - Programmer’s Reference in the Initialize(), Work(), and OnTimer()routines of an FPM application, and you can use it in the Initial

Page 154

i.LON SmartServer 2.0 Programming Tools User’s Guide 223 m_oTimer2.Start(FPM_TF_ONETIME, 0); } void CUFPT_FPM_Application::OnTimer() { if (m_o

Page 155

224 Appendix A - Programmer’s Reference if (m_oTimer1.lsRunning()) { //execute code } GetMode() You can use the GetMode()method to check the typ

Page 156

i.LON SmartServer 2.0 Programming Tools User’s Guide 225 extern "C" STATUS fnRebootSmartServer (int a_nBootFlag); #endif … void CUFPTma

Page 157

10 Introduction 3. In the Server/IP-Address box in the LonMark Resource View, enter the hostname or IP address of your SmartServer and then click t

Page 158

226 Appendix A - Programmer’s Reference int fd = rs232_open(9600); rs232_ioctl() You can use the rs232_ioctl() method in the Initialize() routine t

Page 159

i.LON SmartServer 2.0 Programming Tools User’s Guide 227 parameter is set to IOCTL_SIO_HW_OPTS_SET. This method returns the 0 upon success, and it

Page 160 - Licensing Overview

228 Appendix A - Programmer’s Reference int nBytesRead = ReadBytes(RS232_fd, rxBuf, MAX_RX_BYTE_SIZE); //check whether something h

Page 161 - ONMARK ID

i.LON SmartServer 2.0 Programming Tools User’s Guide 229 The buf parameter specifies a pointer to the memory area containing the data to be writte

Page 162

230 Appendix A - Programmer’s Reference Verify that the file handle is specified in a global variable so that you can reference it from the Work()

Page 163 - Creating a Security DLL File

i.LON SmartServer 2.0 Programming Tools User’s Guide 231 iLON/Development/eclipse/plugins/com.echelon.eclipse.ilon100.fpm_0.9.0/compiler/echelon/f

Page 164

232 Appendix A - Programmer’s Reference The length parameter specifies the maximum number of bytes that are to be read. This method returns the num

Page 165

i.LON SmartServer 2.0 Programming Tools User’s Guide 233 File Access Methods You can read and write to data files on the SmartServer using the fol

Page 166

234 Appendix A - Programmer’s Reference EXAMPLE The following example demonstrates an fopen()method that creates a new text file for writing and as

Page 167

i.LON SmartServer 2.0 Programming Tools User’s Guide 235 fclose(pFile); } } fseek() You can use the fseek()method to set the position i

Page 168

i.LON SmartServer 2.0 Programming Tools User’s Guide 11 7. If you will be deploying this example FPM on a SmartServer 2.0, click Finish to acc

Page 169

236 Appendix A - Programmer’s Reference if((pFile = fopen(Filename,"a")) == NULL) { printf(“Can't open or create i.LON 100 file = %

Page 170 - Verifying the Lock ID

i.LON SmartServer 2.0 Programming Tools User’s Guide 237 Appendix B FPM Development and Deployment Checklist This checklist outlines the steps r

Page 171

238 Appendix B – FPM Development and Deployment Checklist 1. Create User-Defined Functional Profile Template (UFPT) NodeBuilder Resource Editor

Page 172 - Verifying the License Key

i.LON SmartServer 2.0 Programming Tools User’s Guide 239 à Use i.LON SmartServer 2.0 Programming Tool to upload FPM executable module (.app or .dr

Page 173

240 Appendix B – FPM Development and Deployment Checklist à Use Adobe Contribute CS3 with i.LON Vision 2.0 toolkit to create custom FPM configurati

Page 174

i.LON SmartServer 2.0 Programming Tools User’s Guide 241 Appendix C FPM FAQ This FAQ answers common question related to FPMs. .

Page 175

242 Appendix D – i.LON SmartServer Software License Agreement SmartServer FPM FAQs 1. What are Freely Programmable Modules (FPMs)? FPMs are custom

Page 176

i.LON SmartServer 2.0 Programming Tools User’s Guide 243 • For FPM Applications. o Add an internal device using the above XIF (Static FBs) or th

Page 177

244 Appendix D – i.LON SmartServer Software License Agreement If you use Static FBs for the figure above then you would have to create two XIF fi

Page 178 - Supplying FPMs to Customers

i.LON SmartServer 2.0 Programming Tools User’s Guide 245 For Static FBs, you need to create a model file (*.nc extension) in which you declare al

Page 179

12 Introduction 9. You can observe that the Data Point Variable Declarations section automatically includes DECLARE statements for each data point

Page 180

246 Appendix D – i.LON SmartServer Software License Agreement (UFPT), which defines the NVs and CPs to which your FPM will read and write. The Nod

Page 181 - Interface

i.LON SmartServer 2.0 Programming Tools User’s Guide 247 File: fpmMathAdder.xif generated by LonTalk Interface Developer Revision 3.00.35, XIF Ve

Page 182

248 Appendix D – i.LON SmartServer Software License Agreement No. You can only use one NV type (SNVT or UNVT) for each FPM NV which you specify wit

Page 183

i.LON SmartServer 2.0 Programming Tools User’s Guide 249 data points on external devices, dynamic network variables added to the SmartServer’s int

Page 184

250 Appendix D – i.LON SmartServer Software License Agreement void CUFPTfpmTempController::Initialize()] {] // Determine FB index by looking at one

Page 185

i.LON SmartServer 2.0 Programming Tools User’s Guide 251 Yes. This how you pass data from the FPM driver to the FPM applications. 44. Can a FPM a

Page 186

www.echelon.com

Page 187

i.LON SmartServer 2.0 Programming Tools User’s Guide 13 void CUFPTMath::Work() { if (Changed(in1) || Changed(in2)) { out1 = in1 + in2; printf(&quo

Page 188

14 Introduction 3. The Install FPM Module dialog opens with the Deployment Settings window.

Page 189

i.LON SmartServer 2.0 Programming Tools User’s Guide 15 4. Enter the following information if different than the defaults: • The IP address or

Page 190

i.LON SmartServer 2.0 Programming Tools User’s Guide iii Table of Contents Preface ...

Page 191

16 Introduction 5. Expand the LonMark (XIF) folder, expand the root/lonworks/import/<YourCompany> folder, and then select the XIF for your Ma

Page 192

i.LON SmartServer 2.0 Programming Tools User’s Guide 17 Step 6: Testing the FPM Application After you deploy an FPM application, you can test your

Page 193

18 Introduction in2 data points declared in the FPM device and that the out1 data point in the FPM device is updating the dynamic data point on the

Page 194

i.LON SmartServer 2.0 Programming Tools User’s Guide 19 6. Click OK. A data point with the name you specified in step d is added underneath the

Page 195

20 Introduction d. Click OK. Two copies of the data point named “Copy of <DP name>” are added underneath the VirtFB functional block. Note

Page 196

i.LON SmartServer 2.0 Programming Tools User’s Guide 21 5. The Configure – Web Binder Web page opens and the hostnames of the local SmartServer a

Page 197

22 Introduction 14. Enter values for both the VirtFB/count1 and VirtFB/count2 points. Observe the following: • The Math Function/in1 and Math Fu

Page 198

i.LON SmartServer 2.0 Programming Tools User’s Guide 23 2 Installing i.LON SmartServer 2.0 Programming Tools This chapter describes how to instal

Page 199 - Translating Property Files

24 Installing i.LON SmartServer 2.0 Programming Tools Installation and Upgrading Overview The i.LON SmartServer 2.0 DVD includes a demo version of th

Page 200

i.LON SmartServer 2.0 Programming Tools User’s Guide 25 3. Click Install Products. The Install Products dialog opens. 4. Click Echelon i.LON

Page 201

iv Preface Using Include Directives...59 Example Model Files ...

Page 202

26 Installing i.LON SmartServer 2.0 Programming Tools 6. A dialog opens prompting to close all applications currently running on your computer. Cl

Page 203

i.LON SmartServer 2.0 Programming Tools User’s Guide 27 9. Read the license agreement (you can read a printed copy of this license agreement in

Page 204

28 Installing i.LON SmartServer 2.0 Programming Tools 11. By default, the i.LON SmartServer 2.0 Programming Tools software will be installed in the

Page 205

i.LON SmartServer 2.0 Programming Tools User’s Guide 29 13. Click Install to begin the installation. After the i.LON SmartServer 2.0 Programmin

Page 206

30 Installing i.LON SmartServer 2.0 Programming Tools 1. Browse to the LonWorks\iLON\Development\eclipse\workspace.fpm folder on your computer. Thi

Page 207

i.LON SmartServer 2.0 Programming Tools User’s Guide 31 4. The Import Projects window opens. 5. Click Browse. The Browse for Folder dialog op

Page 208

32 Installing i.LON SmartServer 2.0 Programming Tools 6. The selected FPM projects are listed in the Import Projects dialog. Select the Copy Proje

Page 209

i.LON SmartServer 2.0 Programming Tools User’s Guide 33 9. The selected FPM projects appear in the C/C++ Projects View. Converting FPM Projects

Page 210

34 Installing i.LON SmartServer 2.0 Programming Tools 2. Click C/C++ Build. 3. Click Manage Configurations. The Manage Configurations dialog op

Page 211

i.LON SmartServer 2.0 Programming Tools User’s Guide 35 4. Click New. The Create New Configurations dialog opens. 5. In the Name property, e

Page 212

i.LON SmartServer 2.0 Programming Tools User’s Guide v Updating Device Interfaces ...139 De

Page 213

36 Installing i.LON SmartServer 2.0 Programming Tools 7. Click OK twice to return to the C/C++ Build window. 8. In the Configuration property, sel

Page 214

i.LON SmartServer 2.0 Programming Tools User’s Guide 37 b. Click Debugging in the Tool Settings tab. c. In the Level box, select Default (-g).

Page 215

38 Installing i.LON SmartServer 2.0 Programming Tools d. Click OK to return to the C/C++ Projects view. 10. Set the build target for your FPM to

Page 216

i.LON SmartServer 2.0 Programming Tools User’s Guide 39 11. You can upgrade your FPM application or driver, rebuild it, and then upload it to yo

Page 217 - FPM Programmer’s Reference

40 Installing i.LON SmartServer 2.0 Programming Tools

Page 218 - Routines

i.LON SmartServer 2.0 Programming Tools User’s Guide 41 3 Creating FPM Templates This chapter describes how to use the NodeBuilder Resource Edit

Page 219 - Work()

42 Creating FPM Templates Creating FPM Templates Overview Before you can begin writing an FPM, you need to create its user-defined functional profil

Page 220 - OnTimer()

i.LON SmartServer 2.0 Programming Tools User’s Guide 43 2. Create a <YourCompany> folder under the LonWorks\types\user directory on your co

Page 221 - FPM Driver

44 Creating FPM Templates b. The New Resource File Set dialog opens. c. If you plan on integrating your FPM applications with an LNS application

Page 222 - Methods

i.LON SmartServer 2.0 Programming Tools User’s Guide 45 Note: If your company does not have a manufacturer ID, you can get a temporary manufactur

Page 223 - Changed()

vi Preface Internal FPM Data Point Methods...209 Changed()...

Page 224 - Propagate()

46 Creating FPM Templates 5. Create a UFPT. You can create a new UFPT, or you can create one by copying an existing SFPT to your resource file se

Page 225 - ResetPriority()

i.LON SmartServer 2.0 Programming Tools User’s Guide 47 6. To create a UFPT from an SFPT, follow these steps: a. Expand the STANDARD resource fi

Page 226

48 Creating FPM Templates c. You can then add, delete, and edit the network variable and configuration property members in the SFPT to fit your FP

Page 227

i.LON SmartServer 2.0 Programming Tools User’s Guide 49 resource file set (the resource file set that has your manufacturer ID). To add network v

Page 228

50 Creating FPM Templates 4. The selected data type appears below the folder to which it was added in the Profile (center) pane, and the selected

Page 229

i.LON SmartServer 2.0 Programming Tools User’s Guide 51 Name Enter the name of the network variable within the functional profile template. The

Page 230 - SetDpProperty(defOutput)

52 Creating FPM Templates Application Layer Interoperability Guidelines for more information about configuration property restriction flags. • con

Page 231 - UFPT Local Variables

i.LON SmartServer 2.0 Programming Tools User’s Guide 53 7. Repeat steps 3–6 for each data type to be added to the functional profile template.

Page 232

54 Creating FPM Templates 2. The Generate Resources Set dialog opens. 3. Click Yes to generate the updated FPM resource file set. 4. Use FTP

Page 233

i.LON SmartServer 2.0 Programming Tools User’s Guide 55 4 Creating FPM Device Interface (XIF) Files This chapter describes how to write a model f

Page 234

i.LON SmartServer 2.0 Programming Tools User’s Guide vii Appendix C FPM FAQ ...

Page 235 - Timer Methods

56 Creating FPM Device Interface (XIF) Files Creating FPM Device Interface (XIF) Files Overview In order to deploy an FPM application on the SmartSe

Page 236 - Expired()

i.LON SmartServer 2.0 Programming Tools User’s Guide 57 You must declare all the mandatory network variables in the UFPT you created for your FPM.

Page 237 - IsRunning()

58 Creating FPM Device Interface (XIF) Files The type property corresponds to the standard or user-defined network variable type (SCPT or UCPT) use

Page 238 - Reboot Method

i.LON SmartServer 2.0 Programming Tools User’s Guide 59 external_name property, the SmartServer uses the FPT key of the UFPT for the functional bl

Page 239 - RS-232 Interface Methods

60 Creating FPM Device Interface (XIF) Files nviSetPoint implements nviSetPoint; nviTemp implements nviTemp; nvoAC_OnOff implements nvoAirCond

Page 240

i.LON SmartServer 2.0 Programming Tools User’s Guide 61 nviTemp implements nviTemp; nvoAC_OnOff implements nvoAirConditioner_OnOff; nvoFurna

Page 241

62 Creating FPM Device Interface (XIF) Files nciHeartbeat[0],nciOffline[0],nciThrottle[0],nciHysteresis[0] }; /////////////second FB array insta

Page 242

i.LON SmartServer 2.0 Programming Tools User’s Guide 63 In addition, you should create a <YourCompany> folder for your company under the C:\

Page 243 - RS-485 Interface Methods

64 Creating FPM Device Interface (XIF) Files Using Long and Short Command Switch Forms Most command switches come in long and short forms. The long

Page 244 - ONWORKS directory

i.LON SmartServer 2.0 Programming Tools User’s Guide 65 5 Creating FPMs This chapter describes how to use the i.LON SmartServer 2.0 Programming T

Page 245

viii Preface Preface You can use i.LON SmartServer 2.0 Programming Tools to create custom embedded applications and drivers, which are referred to as

Page 246

66 Creating Freely Programmable Modules Creating FPMs Overview You can use the full version of the i.LON SmartServer 2.0 Programming Tool to create

Page 247 - File Access Methods

i.LON SmartServer 2.0 Programming Tools User’s Guide 67 Creating New FPM Projects You can create a new FPM project using the i.LON SmartServer 2.0

Page 248 - if(iTemp)

68 Creating Freely Programmable Modules Creating an FPM To create an FPM application or an FPM driver, follow these steps: 1. Expand the SmartSer

Page 249

i.LON SmartServer 2.0 Programming Tools User’s Guide 69 Alternatively, you can click the resource file set and then click the Create FPM icon ()

Page 250

70 Creating Freely Programmable Modules 5. Optionally, you can specify the project name and the location where the FPM project is to be stored

Page 251 - Checklist

i.LON SmartServer 2.0 Programming Tools User’s Guide 71 8. Clear the check boxes for any of the configuration you do not plan on deploying. For

Page 252

72 Creating Freely Programmable Modules 10. In the Data Point Variable Declarations section, located just below the namespace declaration, you ca

Page 253 - ONWORKS channel

i.LON SmartServer 2.0 Programming Tools User’s Guide 73 disk. See Chapter 3 for more information on generating an updated resource file set and u

Page 254

74 Creating Freely Programmable Modules Manually Importing Individual Data Point Declarations In the source file (.cpp extension) of your FPM, you

Page 255 - FPM FAQ

i.LON SmartServer 2.0 Programming Tools User’s Guide 75 3. An updated DECLARE statement for the selected data point is added to the data point d

Page 256 - SmartServer FPM FAQs

i.LON SmartServer 2.0 Programming Tools User’s Guide ix Welcome The SmartServer includes i.LON SmartServer 2.0 Programming Tools for creating cust

Page 257

76 Creating Freely Programmable Modules SYNTAX DECLARE_FB_INSTANCE_LOCAL(dataType, variableName) EXAMPLE // <= section datapoint variable declar

Page 258

i.LON SmartServer 2.0 Programming Tools User’s Guide 77 //set initial data point values nviSetPoint = 0; nviTemp = 0; nciHystereis = -17

Page 259

78 Creating Freely Programmable Modules The following code demonstrates how to create repeating and one-time timers using the Start() method: CFPM_

Page 260

i.LON SmartServer 2.0 Programming Tools User’s Guide 79 In the algorithm, you can directly read and write values to the data points declared in yo

Page 261

80 Creating Freely Programmable Modules Note: You can modify the behavior of the Changed()method so that it can determine whether any data point pr

Page 262

i.LON SmartServer 2.0 Programming Tools User’s Guide 81 Reading Data Point Properties You can read the name, alias name, time of last update, and

Page 263

82 Creating Freely Programmable Modules } } Reading Structured Data Points To read the value of a structured data point, you first need to store t

Page 264

i.LON SmartServer 2.0 Programming Tools User’s Guide 83 Writing Data Point Values You can write updated values to the scalar and structured data p

Page 265

84 Creating Freely Programmable Modules Writing to Enumerated Data Points To write to an enumerated data point, you need to use the values of the c

Page 266

i.LON SmartServer 2.0 Programming Tools User’s Guide 85 The following code demonstrates how to create an OnTimer()routine that handles the expira

Comments to this Manuals

No comments