beautypg.com

2 case rules – Echelon i.LON SmartServer 2.0 User Manual

Page 196

background image

i.LON SmartServer 2.0 Programmer’s Reference

13-8

input data point is not equal to that of the
compare data point.

FN_NUL

Null. Returns True for all values of the
input. Use this if you want the case rules
for a structure to be used each time there is
a translation.

The value of the input data point, or input data point field,
selected for the case structure will be compared to the
compare value using the selected comparison function. If
the result of this comparison is True, the case rules defined
for the case structure will be used.

For more information on case rules, see Case Rules.

Specify a value to be compared against the value of the
selected data point or data point field. This property is not
used if

is FN_NUL.

13.3.2.2 Case Rules

You can use case rules to determine the value(s) to be assigned to the output data point(s) when a Type
Translator Rule is used. If the output data point is a structure, you can create case rules to determine
the value that will be assigned to each field in the structure.

For each rule, you will specify an input data point (and a field name if the input data point is a
structure) to determine the input value. You will also specify a compare value and a comparison
function. The input value will be compared to the compare value using the specified comparison
function. If the result of the comparison is True, the operation defined by the case rule will be
performed. If the result of the comparison is False, the operation will not be performed, and the value
of the output data point (or field) will not change.

For example, consider a Type Translator Rule that converts a SNVT_scene data point (nviScene) to a
SNVT_switch data point (nvoSwitch). You could create a case rule to assign the value or state fields
of the SNVT_switch data point a value based on scene_number of the SNVT_scene data point. For
example, you could assign the SNVT_switch data point the value 100.0 1 if the scene_number is less
than 2, or 0.0 if it is greater than 2. You can create as many case rules as you want per case structure,
so you can plan on as many contingencies as you like.


0
DataPointFormat[UCPTnickName="nviScene"]
scene_number

LonFormat="UCPTcompFunction">FN_GT

LonFormat="">2


0
DataPointFormat[UCPTnickName="nviScene"]
scene_number
DataPointFormat[UCPTnickName="nvoSwitch"]

LonFormat="UCPTcompFunction">FN_NE

LonFormat="">SC_RESET

0

LonFormat="">0.0

0




1
DataPointFormat[UCPTnickName="nviScene"]
scene_number

LonFormat="UCPTcompFunction">FN_LT