beautypg.com

Notifyonallupdates(), Propagate() – Echelon i.LON SmartServer 2.0 User Manual

Page 224

background image

210

Appendix A - Programmer’s Reference

{

Note: You can use the NotifyOnAllUpdates() method modify so that the
Changed()

method checks whether any data point property has changed, including value, status,

time of last update, and priority. See NotifyOnAllUpdates() for more iinformation.

NotifyOnAllUpdates()

You can call the NotifyOnAllUpdates() method in the constructor of your FPM so that the
Changed()

method checks whether any data point property has changed, including value, status,

time of last update, and priority. Note that if you do not call this method within the FPM constructor,
the Changed() method only checks whether the data point value has changed.

SYNTAX

void NotifyOnAllUpdates(const vector &rDpVarNames);

The rDpVarNames parameter specifies a string vector contain the names of data points declared
in the FPM for which the Changed() method is to check for updates to any of their properties
(value, status, time of last update, and priority).

EXAMPLE

The following example demonstrates how to use the NotifyOnAllUpdates() and the
Changed()

methods to check whether the properties of specific data points in your FPM

application have been updated.

// FPM constructor

vector oDpVarNames;
oDpVarNames.push_back("x");
oDpVarNames.push_back("y");
NotifyOnAllUpdates(oDpVarNames);

 

.........

void CUFPT_FPM_Application::Work()
{

if (Changed(x) || Changed(y))
{
//insert code here

}

{

Propagate()

You can use the PROPAGATE()macro in the Work() and OnTimer()routines of an FPM
application or driver in conjunction with the -> operator (element selection through pointer) to update
the value of a structured data point.

SYNTAX

void PROPAGATE(varName)

The varName parameter specifies a data point declared in the FPM to be updated.

EXAMPLE

The following example demonstrates how to write to structured data points using the
->

operator and the PROPAGATE()method.

nvoSwitch->value = 200;
nvoSwitch->state = 1;
PROPAGATE(nvoSwitch);