NetLinx Programming
35
NXB-KNX Operation/Reference Guide
Example 3 - Load Configuration from File
The configuration can be read and generated from/to a file on the master file system. The reading of the file
can for instance be started in the ONLINE section of the interface.
...
DATA_EVENT[dvKNX]
{
ONLINE :
{
SEND_COMMAND dvKNX,'LIST LOAD MyTable.txt'
}
}
...
// Table written <DATE:TIME>
// ----------------------------
// Actors / Addresses / Flags
// ----------------------------
ADD=1:Switch:1/0/1 // Light 1 On/Off
ADD=2:Switch:1/0/2 // Light 2 On/Off
ADD=3:Switch:1/0/3 // Light 3 On/Off
ADD=4:Switch:1/0/11:PS // Light 1 Status, poll on Start
ADD=5:Switch:1/0/12:PS // Light 2 Status, poll on Start
ADD=6:Switch:1/0/13:PS // Light 3 Status, poll on Start
ADD=7:Switch:1/0/21 // Scene 1+2
ADD=8:Switch:1/0/22 // Scene 3+4
ADD=9:Switch:1/0/31 // Blinds up/down
ADD=10:Switch:1/0/32 // Blinds shutter
ADD=11:Switch:1/0/111 // Dimmer On/Off
ADD=12:Dim4:1/0/112 // Dimmer relative
ADD=13:1Byte:1/0/113 // Dimmer absolute
ADD=14:1Byte:1/0/114:PS // Dimmer read Value, poll on Start
ADD=15:2Byte:1/0/201:EIS5,PS // analog Value, poll on Start
ADD=16:1Byte:1/0/203 // analog Value
ADD=17:3Byte:1/0/205:Time,PS // Time, poll on Start
ADD=18:3Byte:1/0/206:Date,PS // Date, poll on Start
// -------------
// Polltrigger :
// -------------
WHEN=1:2 // Polltrigger
WHEN=1:3 // Polltrigger
WHEN=11:14 // Polltrigger
WHEN=12:14 // Polltrigger
WHEN=13:14 // Polltrigger
WHEN=14:11 // Polltrigger
Example 4 - Main Program
DEFINE_DEVICE
dvKNX = 13001:1:0
dvTP = 10002:1:0
DEFINE_CONSTANT
...
DEFINE_VARIABLE
VOLATILE LONG lKNX_Value[5000] // Feedback array
...
DEFINE_START
...
#INCLUDE 'KNX_Tools.axi'
#INCLUDE 'KNX_Table.axi'
Comments at the end of a line must be separated by at least one space and are
initiated with "//".
Only one command per line is permitted.
Leading spaces are ignored.
Lines starting with "//" are ignored.