Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This set of functions are used in combination In / Out Converter definitions in KNX telegram definitions. Some functions provide helper functionality that are only invokable within such LUA conversion functions that are executed by such an item.
To still have the original value available, two more data points are added. They have extended Item IDs with ".IN" and ".OUT".
The corresponding LUA function for IN conversion would look like that:
function InConv()
Destination.SetValue(nxa.LowByte(Source.Value())) end
! "Destination" would be the object where you would write the result of your conversion. For your InConv() the IN data point would be the receiving item. "SetValue()" is the function to call to push the value into the destination object without sending a telegram. "Source" in IN-convert-function is the object with the original value. "Value()" returns the actual value of the source object.
This means, in the above example the IN data point always will filter the lower byte off the original value.
In an IN-convert-function:

  • Source - the original data item
  • Destination - the IN data point

Here an example for an out converter:
function OutConv()
Destination.WriteValue(nxa.LowByte(Source.Value())) end
! "Destination" would be the object where you would write the result of your conversion. In an OUT-convertfunction it would be the original data item. "WriteValue()" is the function to call to push the value into the destination object with sending a telegram. "Source" in Out-convert-function is the object with the original value. "Value()" returns the actual value of the source object.
The .OUT data point was set by a client, the LUA function OutConv() was called and the low byte value was set to the original data point. The difference between "SetValue()" and "WriteValue()" is, that in case of the latter one a telegram is generated.
In an OUT-convert-function:

  • Source - the OUT data item
  • Destination - the original data point

<file name="Destination.ID">
<h1>Description</h1>
<h1>Signature</h1> string Destination.ID () <p>Gets the ID of "Destination" object. e.g. Destination.ID() in an IN-convert-function would return the ID of the IN data point.</p>
<h1>Parameters</h1> None.
<h1>Return</h1>
<table>
<colgroup> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr><td>string</td><td>itemID of Destination object</td></tr>
</tbody>
</table>
</file>
<file name="Source.ID">
<h1>Description</h1>
<h1>Signature</h1> string Source.ID () <p>Gets the ID of "Source" object. e.g. Source.ID() in an IN-convert-func would return the ID of the original data item.</p>
<h1>Parameters</h1> None.
<h1>Return</h1>
<table>
<colgroup> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr><td>string</td><td>itemID of Source object</td></tr>
</tbody>
</table>
</file>
<file name="Source.Value">
<h1>Description</h1>
<h1>Signature</h1> variant Source.Value () <p>Gets the actual value of "Source" object.</p>
<h1>Parameters</h1> None.
<h1>Return</h1>
<table>
<colgroup> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Type</th> <th>Description</th>
</tr>
<tr><td>variant</td><td>actual value of Source object</td></tr>
</tbody>
</table>
</file>
<file name="Destination.Property">
<h1>Description</h1>
<h1>Signature</h1> variant Destination.Property (number) <p>Gets the value of any property of "Destination" object. e.g. Destination.Property(0) in an IN-convert-function would return the canonical data type of the IN data point.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>number</td><td>M</td><td>propertyID</td></tr>
</tbody>
</table>
<h1>Return</h1>
<table>
<colgroup> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr><td>variant</td><td>value of proporty of Destination object</td></tr>
</tbody>
</table>
</file>
<file name="Source.Property">
<h1>Description</h1>
<h1>Signature</h1> variant Source.Property (number) <p>Gets the value of any property of "Source" object. e.g. Source.Property(0) in an IN-convert-function would return the canonical data type the original data item.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th> <th>Description</th>
</tr> <tr><td></td><td>number</td><td>M</td><td>propertyID</td></tr>
</tbody>
</table>
<h1>Return</h1>
<table>
<colgroup> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr><td>variant</td><td>value of proporty of Source object</td></tr>
</tbody>
</table>
</file>
<file name="Destination.ReadValue">
<h1>Description</h1>
<h1>Signature</h1>
Destination.ReadValue () <p>Generates a read telegram in the "Destination" object.</p>
<h1>Parameters</h1> None.
<h1>Return</h1> None.
</file>
<file name="Destination.SetValue">
<h1>Description</h1>
<h1>Signature</h1>
Destination.SetValue (variant) <p>Sets the value of the "Destination" object, but does not generate any KNX telegram.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>variant</td><td>M</td><td>new value of the Destination object</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>
<file name="Destination.WriteValue">
<h1>Description</h1>
<h1>Signature</h1>
Destination.WriteValue (variant) <p>Sets the value of the "Destination" object and generates a KNX telegram.</p>
<h1>Parameters</h1>
<table>
<colgroup> <col/> <col/> <col/> <col/> </colgroup>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Mandatory/Optional</th>
<th>Description</th>
</tr>
<tr><td></td><td>variant</td><td>M</td><td>new value of the Destination object</td></tr>
</tbody>
</table>
<h1>Return</h1> None.
</file>

  • No labels