Echelon i.LON SmartServer 2.0 Uživatelský manuál

Procházejte online nebo si stáhněte Uživatelský manuál pro Senzory Echelon i.LON SmartServer 2.0. Echelon i.LON SmartServer 2.0 User Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 266
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků

Shrnutí obsahu

Strany 1 - SmartServer 2.0

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

Strany 2

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

Strany 3 - Table of Contents

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

Strany 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

Strany 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-

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 22

104 Creating Freely Programmable Modules

Strany 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

Strany 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.

Strany 25

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

Strany 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

Strany 27

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

Strany 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

Strany 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

Strany 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.

Strany 31

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 36

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

Strany 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

Strany 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

Strany 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

Strany 40

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

Strany 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

Strany 42

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

Strany 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

Strany 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

Strany 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

Strany 46

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

Strany 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

Strany 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

Strany 49

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

Strany 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

Strany 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

Strany 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

Strany 53

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

Strany 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,

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 60

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

Strany 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/<

Strany 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

Strany 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.

Strany 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

Strany 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

Strany 66

144 Deploying Freely Programmable Modules on a SmartServer

Strany 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

Strany 68

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

Strany 69

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

Strany 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

Strany 71

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

Strany 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

Strany 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

Strany 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

Strany 75

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

Strany 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

Strany 77

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 84

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

Strany 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

Strany 86

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

Strany 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

Strany 88

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

Strany 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

Strany 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

Strany 91 - Using the Start() Method

166 Creating FPM Application Licenses

Strany 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

Strany 93

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 101

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

Strany 102 - {

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

Strany 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

Strany 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

Strany 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[

Strany 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

Strany 107

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 112

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

Strany 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.

Strany 114

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 121

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

Strany 122

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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\

Strany 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

Strany 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

Strany 133

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

Strany 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

Strany 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

Strany 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

Strany 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,

Strany 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

Strany 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

Strany 140

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

Strany 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

Strany 142

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

Strany 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

Strany 144

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

Strany 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

Strany 146

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

Strany 147

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

Strany 148

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

Strany 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

Strany 150

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 155

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

Strany 156

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

Strany 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

Strany 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

Strany 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

Strany 160 - Licensing Overview

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

Strany 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

Strany 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()

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 169

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

Strany 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

Strany 171

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

Strany 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

Strany 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

Strany 174

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

Strany 175

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

Strany 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

Strany 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

Strany 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

Strany 179

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 184

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

Strany 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

Strany 186

www.echelon.com

Strany 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

Strany 188

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

Strany 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

Strany 190

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

Strany 191

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 201

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 210

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

Strany 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

Strany 212

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

Strany 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

Strany 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).

Strany 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

Strany 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

Strany 217 - FPM Programmer’s Reference

40 Installing i.LON SmartServer 2.0 Programming Tools

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 223 - Changed()

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 230 - SetDpProperty(defOutput)

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

Strany 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.

Strany 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

Strany 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

Strany 234

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

Strany 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

Strany 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.

Strany 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

Strany 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

Strany 239 - RS-232 Interface Methods

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

Strany 240

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

Strany 241

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

Strany 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:\

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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 ()

Strany 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

Strany 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

Strany 252

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

Strany 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

Strany 254

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

Strany 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

Strany 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

Strany 257

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

Strany 258

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

Strany 259

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Komentáře k této Příručce

Žádné komentáře