AMX Combined Devices Only Appear as One Device to Master Code
Table of Contents
Brand:
- AMX
Models:
- NetLinx
Overview:
AMX Combined Devices Only Appear as One Device to Master Code.
Problem:
The existing program has combined devices.
COMBINE_DEVICES(VTP,TP_1,TP_2)
You need to get a button event from one of the real panels even if you have combined the devices with a virtual panel. You can see the button event in the diagnostics window in NetLinx Studio. You have tried to use a regular button event on TP_1 but it doesn't work, why?
Cause:
When you combine devices, all the combined devices report ONLY as the primary device in the statement. In your example, all pushes will come in as [VTP,x]. The only exceptions to this are DATA_EVENT/ONLINE: and DATA_EVENT/OFFLINE: sections of your code. If you need to get individual panel information anywhere else in your code, you cannot use a combine command.
Solutions:
Options are to replace with stacked events or a device array.
Stack Events
BUTTON_EVENT[TP_1,3]
BUTTON_EVENT[TP_2,3]
{
IF(BUTTON.INPUT.DEVICE=TP_1)
{ //DO THIS }
IF(BUTTON.INPUT.DEVICE=TP_2)
{ //DO THAT }
}
Device Array
DEFINE_DEVICE
TP_1 = 128:1:0
TP_2 = 129:1:0
DEFINE_VARIABLE
DEV PNLSET[2]={TP_1,TP_2}
DEFINE_EVENT
BUTTON_EVENT[PNLSET,3]
{
IF(BUTTON.INPUT.DEVICE=TP_1)
{ //DO THIS }
IF(BUTTON.INPUT.DEVICE=TP_2)
{ //DO THAT }
}Table of Contents