2 get functions, 3 set functions, Get functions -6 – Echelon i.LON SmartServer 2.0 User Manual
Page 39: Set functions -6

i.LON SmartServer 2.0 Programmer’s Reference
3-6
3.4.2
Get Functions
You can use the Get function to retrieve the configuration of any application instance or item that you
have added to the SmartServer. For example, you could use the Get function to retrieve the
configurations of the Alarm Generators, Data Loggers, Schedulers, and other application instances that
have been added to the SmartServer. Similarly, you could use the Get function to retrieve the
configurations of the data points on the Data Server (Dp_Cfg), or retrieve the L
ON
W
ORKS
application
devices (LON_Device_Cfg), the Modbus devices (MOD_Device_Cfg), and other network items on the
SmartServer. Note that you must reference the item whose configuration is to be retrieved by its
Consider a scenario where you have used a List function to retrieve a list containing the
of each Alarm Generator that has been added to the SmartServer. You could use the list as the input
for the Get function. The Get function would return the configuration of all the Alarm Generators
included in the list. You can also use the Get function to retrieve the configuration of a single Alarm
Generator, by supplying the
3.4.3
Set Functions
You can use the Set function to write to each of the XML files described in the previous section.
When you invoke the Set function for an application for the first time, the associated XML file will be
created in the root/config/network/
SmartServer, if it has not already been created. All data defined in the input supplied to the function
will be added to the XML file. Following this, you can use the Set function to add more data to the
XML file or to overwrite existing data.
For example, the first time an application invokes the Set function to create an Alarm Generator
functional block, the #8000010128000000[4].UFPTalarmGenerator.xml will be created in the
root/config/network/
does not already exist based on the creation of another alarm generator functional block instance).
The file will contain an element for each Alarm Generator defined in the input passed to the function.
After its initial invocation, you can use Set function to overwrite the values of the properties defined
for the Alarm Generator application. You can also use it to add new Alarm Generators to the XML
file, or to overwrite the configuration of existing Alarm Generators.
When using the Set function to create an item such as an Alarm Generator, you should consider using
output supplied by the corresponding Get function as the basis for your input. The following
procedure describes how you might do so using the Alarm Generator functions. You could use this
algorithm when programming any of the SmartServer applications.
1. Invoke the List function to generate a list of Alarm Generators that have been added to the
SmartServer. This list includes the
2. Invoke the Get function, using the list returned by the List function as the input. The function will
return the configuration of each Alarm Generator included in the list output.
3. Review the output from step 2, and choose an Alarm Generator to serve as your “default” Alarm
Generator. The Get output for this Alarm Generator will serve as the basis for the next Alarm
Generator you create. Modify the values of each property in the response returned by Get to
match the configuration you want for the new Alarm Generator. This will be more efficient than
building the input for the Set function from scratch.
Note: You must change the
Otherwise, the next step of this procedure will overwrite the configuration of the default Alarm
Generator you have chosen.
4. Invoke the Set function, using the modified response from Step 3 as input. The new item is
successfully created, without recreating an input that defines an entire Alarm Generator
configuration from scratch, and with minimal risk of format errors. Chapters 4-12 will clarify the
benefits of this algorithm.