Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This set of functions are is used in combination with 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".

IN Converter

The corresponding LUA function for IN conversion would look like that:

Code Block
function InConv()

...


    Destination.SetValue(nxa.LowByte(Source.Value()))
end


Warning

...

"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

OUT Converter

Here an example for an out converter:

Code Block
function OutConv()

...


    Destination.WriteValue(nxa.LowByte(Source.Value()))
end


Warning

...

"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

...

  • data point

...