Rawvalue, Sourceindex, D rawvalue – Echelon OpenLNS User Manual
Page 284
OpenLNS Programmer's Reference
247
RawValue
Summary
Contains the value of the DataPoint as a raw byte array.
To read the value of the data point’s source object (the value
of the source object in the OpenLNS database and on the
network device containing the source object) as a raw byte
array, call the DataPoint object's Read method, and then
read this property. If the AutoRead property is set to True,
the Read method will be called automatically each time this
property is read.
To write 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 Value and FormattedValue 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. So, when you
write to the RawValue property, OpenLNS will update the
values of the Value and FormattedValue properties
automatically, to match the updated RawValue property.
If the data point’s source object is a network variable, you
should note that reading the RawValue 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 RawValue property is read, and the
poll fails, an exception will be thrown.
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 LNS accesses the raw value of the
configuration property (either from the physical device
containing the configuration property, or from the LNS
database).You should also be aware that some configuration
properties contain a constant attribute. 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 RawValue property, an
exception will be thrown. However, in some cases, you can
use the ConstantAttribute property to set or turn off this
attribute using LNS.
You can use the MinValue and MaxValue properties to set
the minimum and maximum possible values for the data
point. However, OpenLNS will only enforce the range
established by these properties when you write to the
FormattedValue property. You should program your
application to enforce this range for the RawValue property