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
Description
Signature
string Destination.ID ()
Gets the ID of "Destination" object. e.g. Destination.ID() in an IN-convert-function would return the ID of the IN data point.
Parameters
None.
Return
Type | Description |
---|---|
string | itemID of Destination object |
Description
Signature
string Source.ID ()
Gets the ID of "Source" object. e.g. Source.ID() in an IN-convert-func would return the ID of the original data item.
Parameters
None.
Return
Type | Description |
---|---|
string | itemID of Source object |
Description
Signature
variant Source.Value ()
Gets the actual value of "Source" object.
Parameters
None.
Return
Type | Description |
---|---|
variant | actual value of Source object |
Description
Signature
variant Destination.Property (number)
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.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
number | M | propertyID |
Return
Type | Description |
---|---|
variant | value of proporty of Destination object |
Description
Signature
variant Source.Property (number)
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.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
number | M | propertyID |
Return
Type | Description |
---|---|
variant | value of proporty of Source object |
Description
Signature
Destination.ReadValue ()
Generates a read telegram in the "Destination" object.
Parameters
None.
Return
None.
Description
Signature
Destination.SetValue (variant)
Sets the value of the "Destination" object, but does not generate any KNX telegram.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
variant | M | new value of the Destination object |
Return
None.
Description
Signature
Destination.WriteValue (variant)
Sets the value of the "Destination" object and generates a KNX telegram.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
variant | M | new value of the Destination object |
Return
None.