DEVCHAN and GET_LAST
Jeff Lockyear
Junior Member
I'm familiar with using DEVCHAN arrays, and I can use GET_LAST with said array when there's only one touchpanel. If there's more than one TP, I run into problems with the value the GET_LAST gives me (I want it to be the same for each different panel).
DEVCHAN TP_BUTTON [] =
{
{TP1,10},{TP1,11},{TP1,12},
{TP2,15},{TP2,16},{TP2,17}
}
GET_LAST would return a 4 when TP2,15 is pushed, but in my code it would be much better to see a 1, like when TP1,10 is pushed. Do I need a separate DEVCHAN array per touchpanel? If I put all the panels in a DEV array first, I can't put that DEV in a DEVCHAN array, which would seem the best solution.
Make any sense?
Jeff Lockyear
Synergy Home Systems, Toronto
DEVCHAN TP_BUTTON [] =
{
{TP1,10},{TP1,11},{TP1,12},
{TP2,15},{TP2,16},{TP2,17}
}
GET_LAST would return a 4 when TP2,15 is pushed, but in my code it would be much better to see a 1, like when TP1,10 is pushed. Do I need a separate DEVCHAN array per touchpanel? If I put all the panels in a DEV array first, I can't put that DEV in a DEVCHAN array, which would seem the best solution.
Make any sense?
Jeff Lockyear
Synergy Home Systems, Toronto
Comments
-
Try this.
Jeff,
Set up an array of devices and a separate array of channels.Define_Device dvTP1 = 10001:1:0 dvTP2 = 10002:1:0 Define_Constant INTEGER nButtons[] = { 10, 11, 12 } Define_Variable DEV dv_TP[] = { dvTP1 dvTP2 } Volatile nCurrent_TP Volatile nCurrent_Button Define_Event Button_Event[dv_TP,nButtons] { Push: { nCurrent_TP = Get_Last(dv_TP) nCurrent_Button = Get_Last(nButtons) } } -
<Click!> Looking at that makes a lot of sense. I'll give it a shot. Thanks a ton.
Jeff
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums