8 snvt_state_to_16xsnvt_switch, 9 snvt_switch_to_snvt_lev_disc – Echelon i.LON SmartServer 2.0 User Manual
Page 185

i.LON SmartServer 2.0 Programmer’s Reference
12-13
<UCPTtranslatorRule>SNVT_setting_TO_SNVT_switch</UCPTtranslatorRule>
<SCPTdelayTime>0</SCPTdelayTime>
</Item>
</iLonItem>
</Set>
12.3.4.8 SNVT_state_TO_16xSNVT_switch
You can use this Type Translator Rule to convert a single SNVT_state input data point to up to 16
SNVT_switch output data points. The value of the state field of each of the SNVT_switch input data
points will be assigned to a field in the SNVT_state output data point.
• The SNVT_state input data point is defined by a <DataPointFormat> element that have a “Dp
Type” attribute of “Input”. The input data point referenced by <UCPTname> must have a
<UCPTformatDescription> property of #0000000000000000[0]. SNVT_state and a
<UCPTnickName> of “Input0”.
• The 16 SNVT_switch data points to be translated are defined by a list of <DataPoint> elements
that have a “Dp Type” attribute of “Output”. The output data points referenced by <UCPTname>
must have a <UCPTformatDescription> property of #0000000000000000[0]. SNVT_switch and
a <UCPTnickName> in the range of Output0 to Output15.
The value of the state field of each input data point will be read and stored in bitX of the output data
point, where X represents the <UCPTnickName> of the input data point. The state field in each
SNVT_switch output data point will be assigned a value based on the <UCPTnickName> of the
output data point and the corresponding value in bitX of the SNVT_state input data point. For
example, the SNVT_switch output data point with a <UCPTnickName> of Output0 will be assigned a
value based on Bit0 of the input data point. Or, the SNVT_switch output data point with a
<UCPTnickName> of Output8 will be assigned a value based on Bit8 of the input data point.
If the value of a BitX field of the SNVT_state input data point is 0, then the applicable SNVT_switch
output data point will be assigned the value 0.0 0. If the value of a BitX field of the SNVT_state input
data point is 1, then the applicable SNVT_switch output data point will be assigned the value 100.0 1.
The following code demonstrates how to use the Set function to create a type translator that uses this
<UCPTtranslatorRule>:
<Set xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem>
<Item
xsi:type="UFPTtypeTranslator_Cfg">
<UCPTname>Net/LON/iLON
App/Type
Translator[10]</UCPTname>
<DataPoint
dpType="Input">
<UCPTname>Net/LON/iLON
App/VirtFb/nvoState</UCPTname>
<UCPTformatDescription>#0000000000000000[0].SNVT_state</UCPTformatDescription>
<UCPTnickName>Input0</UCPTnickName>
</DataPoint>
<DataPoint
dpType="Output">
<UCPTname>Net/LON/iLON
App/VirtFb/nviSwitch_1</UCPTname>
<UCPTformatDescription>#0000000000000000[0].SNVT_switch</UCPTformatDescription>
<UCPTnickName>Output0</UCPTnickName>
</DataPoint>
<DataPoint
dpType="Output">
<UCPTname>Net/LON/iLON
App/VirtFb/nviSwitch_2</UCPTname>
<UCPTformatDescription>#0000000000000000[0].SNVT_switch</UCPTformatDescription>
<UCPTnickName>Output1</UCPTnickName>
</DataPoint>
<UCPTtranslatorRule>SNVT_state_TO_16xSNVT_switch</UCPTtranslatorRule>
<SCPTdelayTime>0</SCPTdelayTime>
</Item>
</iLon
Item>
</Set>
12.3.4.9 SNVT_switch_TO_SNVT_lev_disc
You can use this Type Translator Rule to translate an input data point of type SNVT_switch to an
output data point of type SNVT_lev_disc.