Echelon OpenLNS User Manual

Page 289

Advertising
background image

OpenLNS Programmer's Reference

252

To read the value of the data point’s source object (the value

of the source object in the OpenLNS database and on the

physical device containing the source object) as an

unformatted numeric value, use the DataPoint object's Read

method, and then read this property. If the AutoRead

property is set to TRUE, the Read method will automatically

be called each time this property is read.
To write to the value stored in this property to the data

point’s source object, set this property to the desired value,

and call the DataPoint object's Write method. If the

AutoWrite property is set to TRUE, the Write method will

automatically be called each time this property is written.
You should note that this property shares memory space with

the FormattedValue and RawValue properties, meaning that

the information contained in all three properties represents

the same value. The only difference between the three

properties is that each of them is formatted differently;

therefore, when you write to the Value property, OpenLNS

will update the values of the FormattedValue and RawValue

properties automatically, to match the updated Value

property.
However, you can only use the Value property to read and

write the values of data points and data point fields that take

single, scalar values, such as SNVT_lev_percent. To read

and write the value of data points containing structures, such

as SNVT_switch, use the FormattedValue and RawValue

properties. You can only write scalar values to the Value

property. If you write a non-scalar value to the Value

property, the LCA, #122 exception is thrown.
If the data point’s source object is a network variable, you

should note that reading the Value property always causes a

poll and returns the resulting response, even if the network

variable is bound to the host or if the Data Server is already

polling. If the Value property is read, and the poll fails, a DS

200 exception is raised, which identifies the error as a

communications error.
If the data point’s source object is a configuration property,

you can use the ValueStatus property to determine if the

value stored in the OpenLNS database for the configuration

property matches the value stored on the physical device. In

addition, the setting of the DataPoint object’s SourceOptions

property affects how OpenLNS accesses the value of the

configuration property (either from the physical device

containing the configuration property, or from the OpenLNS

database). You should also consider that some configuration

properties contain a ConstantAttribute property. If a

configuration property has the constant attribute set, it

marks the configuration property as read-only. If this

attribute is set and you attempt to write to the Value

property, an exception will be thrown. However, in some

cases, you can use the ConstantAttribute property to set or

Advertising