Reading data point properties, Reading data point values – Echelon i.LON SmartServer 2.0 User Manual

Page 95

Advertising
background image

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 status of each data point declared in the
FPM application in the Initialize(), Work(), and OnTimer()routines. To read these data
point properties, you use a collection of get property methods belonging to each data point. The
methods that you can call to read the data point properties are as follows:

Data Point

Property

Get Property Method

Name

const char* GetDpPropertyAsString(FPM::Dp::cfgUCPTname)

Alias name

const char*
GetDpPropertyAsString(FPM::Dp::cfgUCPTAliasName)

Time of
Last Update

timespec
GetDpPropertyAsTimeSpec(FPM::Dp::dataUCPTlastUpdate)

Status

FPM::Dp::PointStatus
GetDpPropertyAsPointStatus(FPM::Dp::dataUCPTstatus)

The following code demonstrates how to read data point properties using these methods:

void CUFPTHVACController::Work()
{

const char* nviSetPoint_name;

const char* nviSetPoint_AliasName;

timespec

nviSetPoint_lastUpdateTime;

FPM::Dp::PointStatus

nviTemp_status;

nviSetPoint_name =
nviSetPoint.GetDpPropertyAsString(FPM::Dp::cfgUCPTname);

nviSetPoint_AliasName =
nviSetPoint.GetDpPropertyAsString(FPM::Dp::cfgUCPTAliasName);

nviSetPoint_lastUpdateTime =
nviSetPoint.GetDpPropertyAsTimeSpec(FPM::Dp::dataUCPTlastUpdate);

nviTemp_status =
nviTemp.GetDpPropertyAsPointStatus(FPM::Dp::dataUCPTstatus);

if (nviTemp_status == FPM::Dp::AL_ALM_CONDITION)

{
nvoHVACMode = hvac_t::HVAC_COOL;

}

}

Reading Data Point Values

You can directly read the values of the scalar, structured, and enumerated data points declared in your
FPM application in the Work() routine. Upon reading the data points, you can execute code based on
the current values stored in them.

Reading Scalar Data Points

You can directly read the value of a scalar data point declared in your FPM by simply referencing its
name.

void CUFPTHVACController::Work()
{

if (nviTemp > nviSetPoint + (nciHysteresis*1.8+32))

//execute some code

Advertising