Echelon LNS User Manual

Page 22

Advertising
background image

LNS Programmer's Guide

8

such as language, measurement system (U.S. or Systeme Internationale), date formats,
time formats, and decimal number formats. The settings of a FormatLocale object
determine how data accessed through the FormattedValue properties of all DataPoint

objects will be displayed when your application uses that FormatLocale object.

Each client application can select the FormatLocale object it will use by passing that
FormatLocale to the CurrentFormatLocale property of the ObjectServer object

before opening any networks and formatting any data. As a result, client applications in

different regions can use their own sets of local formats when displaying data, without
affecting the data formatting used by other clients. This greatly reduces the risk of your

application returning information that is confusing or misleading due to formatting

changes made by another application.

You can access the FormatLocales collection through the FormatLocales property of

the ObjectServer object. When initialized, the FormatLocales collection contains 4
pre-defined FormatLocale objects:

1. UserDefaultRegionalSettings. This is the default value for the

CurrentFormatLocale property. When you use this FormatLocale object, all the

properties will be set based on the user-defined Windows regional settings for the

user currently logged onto the PC running your application. You can change the

regional settings on a PC using the Windows control panel Regional Options applet.
Consult the Microsoft Developer’s Network (MSDN) documentation of the Win32
GetLocaleInfo() function for more information on the Windows regional settings.

2. SystemDefaultRegionalSettings. When you use this FormatLocale object, all

the properties will be set based on the default Windows regional settings on the PC
running the application. The default settings may vary, depending on which

operating system is installed on the PC. Consult the MSDN documentation of the
Win32 GetLocaleInfo() function for more information on the Windows Regional

settings.

3. LonMarkCompatibility. When you use this FormatLocale object, all properties

will be set so that formatted data will be displayed based on the LonMark

standards

used prior to LNS 3.0, when localized formatting was not available. In this case,
Systeme Internationale measurement units, LonMark-defined time and date

formats, and U.S. options for everything else, will be used to display all formatted

data.

4. ISO8601DateAndTime. When you use this FormatLocale object, the settings will

be the same as the LonMarkCompatibility settings, except for the localized time

and date formats, which will be based on the ISO 8601 standard. This standard helps

avoid confusion that may be caused by the different national notations used for dates
and times, and increases the portability of computer user interfaces.

The pre-defined FormatLocale objects are read-only, but you can create custom
FormatLocale objects to suit the specific needs of your application with the Add

method of the FormatLocales collection. Note that all custom FormatLocale objects

are instantiated with the same initial settings as the pre-defined
UserDefaultRegionalSettings FormatLocale object described above.

For more information on the FormatLocales collection, see Data Formatting on page

241.

Advertising