NetLinx Programming
34
NXB-KNX KNX Communications Gateway
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'
DEFINE_MODULE 'AMX_KNX_Updater' Updater(dvKNX, lKNX_Value) //Module handles update
//of array for feedback control
DEFINE_MODULE 'AMX_NXB_MOD' nxbMod(dvKNX) //Module handles remote
//logging from NXB-KNX
//as well as facilitates
//List Save and
//List Load functions
DEFINE_EVENT
...
DATA_EVENT[dvKNX]
{
ONLINE :
{
SEND_COMMAND dvKNX,'LIST LOAD MyTable.txt'
}
}
BUTTON_EVENT[dvTP,1]
{
PUSH:
{
KNXSet(dvKNX,1,1) // Light 1 ON
KNXSet(dvKNX,16,128) // Ballast to 50% Light 2
KNXSet(dvKNX,12,10) // Dimmer up Light 3
}
RELEASE:
{
KNXSet(dvKNX,12,0) // Dimmer Stop Light 3
}
}
CHANNEL_EVENT [dvKNX, 2] // Feedback Light 1
{
ON:
{
ON[dvTp,31]
}
OFF:
{
OFF[dvTp,31]
}
}
LEVEL_EVENT[dvKNX,21] //Feedback Level light 2
{
SEND_LEVEL dvTP,1,LEVEL.VALUE
}
DEFINE_PROGRAM