In an Axcess system, it was common practice to DEFINE_COMBINE touch panels. This is still available in NetLinx; however, it is recommended to use DEV arrays of panels instead. There is a sample program below.
The most common problem with DEFINE_COMBINE is when all panels are “almost" identical, but one panel needs to route preview video to this destination, while another panel needs to route preview video to another destination. In this circumstance, with the panels combined, you would need to assign unique channel codes to each button to make it work and hope that other buttons were never added to the other panel. To eliminate this problem, it is now recommended to put panels in a DEV array. This will provide DEFINE_COMBINE functionality, and also let the program determine which panel actually pressed the button to perform these “almost" identical functions. This is always recommended, even when the system only has one panel, because if a web panel was ever added (for example), it could simply be added to the DEV array.
Here is the example:
DEFINE_DEVICE
dvTp1a = 128:1:0 // AXT-CV10 #1
dvTp2a = 132:1:0 // AXT-CV10 #2
DEFINE_VARIABLE
dvPnls[] = {dvTp1a, dvTp2a}
DEFINE_EVENT
BUTTON_EVENT[dvPnls,1] // Select source and preview
{
PUSH:
{
STACK_VAR INTEGER nLAST_PANEL
nLAST_PANEL = GET_LAST(dvPnls) //GETS INDEX #, ORDER OF PANELS IN ARRAY
//if you always want the two panels to do the same thing, like a combine, you don't
//have to filter the panel out so you won't need anything but the function you want
//to perform
IF(nLAST_PANEL = 1) //this could also be a switch()..case
{
//do something
}
ELSE IF(nLAST_PANEL = 2)
{
//do something
}
}
}
Note 1: If using 'on the fly' combining/uncombining, e.g. COMBINE_DEVICES, and you want to change what is combined with the virtual device, you must clear the combines from the virtual device using UNCOMBINE_DEVICES first. You cannot just a add a single device to the combine and invoke COMBINE_DEVICES again.
This is not recommended:
DEFINE_CALL 'COMBINE PANELS' (DEV vdvTP, DEV dvTP[ ])
{
COMBINE_DEVICES (vdvTP,dvTP)
}
This is better:
DEFINE_CALL 'COMBINE PANELS' (DEV vdvTP, DEV dvTP[ ])
{
UNCOMBINE_DEVICESn (vdvTP) COMBINE_DEVICES (vdvTP,dvTP)
}
Note 2: If the device invoking the change in combined group is a member of the group, the combining should be done in a RELEASE, not a PUSH.
This is not recommended:
BUTTON_EVENT[dvTP1,1]
{
PUSH:
{
UNCOMBINE_DEVICESn (vdvTP) COMBINE_DEVICES (vdvTP,dvTP1)
}
}
This is better:
BUTTON_EVENT[dvTP1,1]
{
RELEASE:
{
UNCOMBINE_DEVICESn (vdvTP) COMBINE_DEVICES (vdvTP,dvTP1)
}
}