how many levels are allowed per device?
jordimgomez
Posts: 3
Hi,
After having some issues with a module I'm writing, I could finally isolate the problem to the following netlinx code.
(****************************)
(* CONSTANTS *)
DEFINE_CONSTANT
BTN_TOGGLE = 4
(* VARIABLES *)
DEFINE_VARIABLE
DEVLEV AUDIO_SOURCE [] = {
{vdvKNX, 1},
{vdvKNX, 2},
(* {vdvKNX, 3},
{vdvKNX, 4},
{vdvKNX, 5},
{vdvKNX, 6},
{vdvKNX, 7},
{vdvKNX, 8},
{vdvKNX, 9},
{vdvKNX, 10},*)
{vdvKNX, 11},
{vdvKNX, 12},
{vdvKNX, 13},
{vdvKNX, 14},
{vdvKNX, 15},
{vdvKNX, 16},
{vdvKNX, 17},
{vdvKNX, 18},
{vdvKNX, 19},
{vdvKNX, 20}
}
(* EVENTS *)
DEFINE_EVENT
BUTTON_EVENT[ dvTP, BTN_TOGGLE]
{
RELEASE:
{
send_level AUDIO_SOURCE, 0
send_level AUDIO_SOURCE, 1
}
}
LEVEL_EVENT[AUDIO_SOURCE]
{
local_var integer idxLevel
idxLevel = get_last( AUDIO_SOURCE)
send_string 0, "'Audio source Level event - idx Level '"
}
(****************************)
Whenever I press the BTN_TOGGLE in the panel, I would expect this code to print:
(0000031307) Audio source Level event - idx [1] Level [0]
(0000031308) Audio source Level event - idx [2] Level [0]
(0000031307) Audio source Level event - idx [11] Level [0]
(0000031308) Audio source Level event - idx [12] Level [0]
(0000031307) Audio source Level event - idx [13] Level [0]
(0000031308) Audio source Level event - idx [14] Level [0]
(0000031307) Audio source Level event - idx [15] Level [0]
(0000031308) Audio source Level event - idx [16] Level [0]
(0000031308) Audio source Level event - idx [17] Level [0]
(0000031308) Audio source Level event - idx [18] Level [0]
(0000031308) Audio source Level event - idx [19] Level [0]
(0000031308) Audio source Level event - idx [20] Level [0]
(0000031308) Audio source Level event - idx [1] Level [1]
(0000031309) Audio source Level event - idx [2] Level [1]
(0000031307) Audio source Level event - idx [11] Level [1]
(0000031308) Audio source Level event - idx [12] Level [1]
(0000031307) Audio source Level event - idx [13] Level [1]
(0000031308) Audio source Level event - idx [14] Level [1]
(0000031307) Audio source Level event - idx [15] Level [1]
(0000031308) Audio source Level event - idx [16] Level [1]
(0000031308) Audio source Level event - idx [17] Level [1]
(0000031308) Audio source Level event - idx [18] Level [1]
(0000031308) Audio source Level event - idx [19] Level [1]
(0000031308) Audio source Level event - idx [20] Level [1]
(don't pay attention to the time stamp)
Instead this is the following outcome:
(0000031307) Audio source Level event - idx [1] Level [0]
(0000031308) Audio source Level event - idx [2] Level [0]
(0000031308) Audio source Level event - idx [1] Level [1]
(0000031309) Audio source Level event - idx [2] Level [1]
I have tried modifying the different levels assigned to AUDIO_SOURCE but I never get to go beyond 8 levels. It seems as if send_level would not work with levels beyond 8.
How many levels are allowed per device? Or better then, what's the highest level allowed in a specific device?
Thanks,
Jordi
After having some issues with a module I'm writing, I could finally isolate the problem to the following netlinx code.
(****************************)
(* CONSTANTS *)
DEFINE_CONSTANT
BTN_TOGGLE = 4
(* VARIABLES *)
DEFINE_VARIABLE
DEVLEV AUDIO_SOURCE [] = {
{vdvKNX, 1},
{vdvKNX, 2},
(* {vdvKNX, 3},
{vdvKNX, 4},
{vdvKNX, 5},
{vdvKNX, 6},
{vdvKNX, 7},
{vdvKNX, 8},
{vdvKNX, 9},
{vdvKNX, 10},*)
{vdvKNX, 11},
{vdvKNX, 12},
{vdvKNX, 13},
{vdvKNX, 14},
{vdvKNX, 15},
{vdvKNX, 16},
{vdvKNX, 17},
{vdvKNX, 18},
{vdvKNX, 19},
{vdvKNX, 20}
}
(* EVENTS *)
DEFINE_EVENT
BUTTON_EVENT[ dvTP, BTN_TOGGLE]
{
RELEASE:
{
send_level AUDIO_SOURCE, 0
send_level AUDIO_SOURCE, 1
}
}
LEVEL_EVENT[AUDIO_SOURCE]
{
local_var integer idxLevel
idxLevel = get_last( AUDIO_SOURCE)
send_string 0, "'Audio source Level event - idx Level '"
}
(****************************)
Whenever I press the BTN_TOGGLE in the panel, I would expect this code to print:
(0000031307) Audio source Level event - idx [1] Level [0]
(0000031308) Audio source Level event - idx [2] Level [0]
(0000031307) Audio source Level event - idx [11] Level [0]
(0000031308) Audio source Level event - idx [12] Level [0]
(0000031307) Audio source Level event - idx [13] Level [0]
(0000031308) Audio source Level event - idx [14] Level [0]
(0000031307) Audio source Level event - idx [15] Level [0]
(0000031308) Audio source Level event - idx [16] Level [0]
(0000031308) Audio source Level event - idx [17] Level [0]
(0000031308) Audio source Level event - idx [18] Level [0]
(0000031308) Audio source Level event - idx [19] Level [0]
(0000031308) Audio source Level event - idx [20] Level [0]
(0000031308) Audio source Level event - idx [1] Level [1]
(0000031309) Audio source Level event - idx [2] Level [1]
(0000031307) Audio source Level event - idx [11] Level [1]
(0000031308) Audio source Level event - idx [12] Level [1]
(0000031307) Audio source Level event - idx [13] Level [1]
(0000031308) Audio source Level event - idx [14] Level [1]
(0000031307) Audio source Level event - idx [15] Level [1]
(0000031308) Audio source Level event - idx [16] Level [1]
(0000031308) Audio source Level event - idx [17] Level [1]
(0000031308) Audio source Level event - idx [18] Level [1]
(0000031308) Audio source Level event - idx [19] Level [1]
(0000031308) Audio source Level event - idx [20] Level [1]
(don't pay attention to the time stamp)
Instead this is the following outcome:
(0000031307) Audio source Level event - idx [1] Level [0]
(0000031308) Audio source Level event - idx [2] Level [0]
(0000031308) Audio source Level event - idx [1] Level [1]
(0000031309) Audio source Level event - idx [2] Level [1]
I have tried modifying the different levels assigned to AUDIO_SOURCE but I never get to go beyond 8 levels. It seems as if send_level would not work with levels beyond 8.
How many levels are allowed per device? Or better then, what's the highest level allowed in a specific device?
Thanks,
Jordi
0
Comments
I don't recall but try set_virtual_level_count and see if it helps.
Paul
A real TP (G4) device has:
100 ports
4000 channels per port
600 levels per port
A virtual device has:
1 port
255 channels
8 levels
If you need more ports or channels or levels for a virtual device then you can use set_virtual_port_count, set_virtual_channel_count, and set_ virtual_level_count to increase the numbers.
If you are combining real TP devices with virtual devices make sure the ports, channels, and levels of the virtual device meets the usage of the real device or funky stuff (technical term) may happen.
You’ll notice that the very first time you press BTN_TOGGLE you will only get a 20 line printout showing a value of 1 and every subsequent push will generate a 40 line printout showing a value of 0 and then 1.
This is because a level_event is only generated when the level value actually changes and by default the level value at bootup is 0 so the first time you do a send_level of 0 nothing will happen.