Having trouble combining touchpanels
fogled@mizzou
Posts: 549
I'm working on a system with 2 ELO touchpanels driven from TP/I4 devices. But I can't seem to get the panels combined. Here are relevant code snippets:
The above code does not work at all as written. But if I comment out the DEFINE_COMBINE area and change the panel references to dvTP1, it works on that panel just fine.
Remember, I'm a newbie at this stuff, and I'm probably making some simple mistake - do I have the DEFINE_COMBINE in the wrong place or something? ?ny help is greatly appreciated!
Thanks,
DEFINE_DEVICE dvTP1 = 10001:1:0 dvTP2 = 10002:1:0 DEFINE_VARIABLE DEV dvPanels DEFINE_COMBINE (dvPanels, dvTP1, dvTP2) DEFINE_EVENT button_event[dvPanels,39] //projector power on { push: { on[dvPanels,39] proj_power = 1 } }
The above code does not work at all as written. But if I comment out the DEFINE_COMBINE area and change the panel references to dvTP1, it works on that panel just fine.
Remember, I'm a newbie at this stuff, and I'm probably making some simple mistake - do I have the DEFINE_COMBINE in the wrong place or something? ?ny help is greatly appreciated!
Thanks,
0
Comments
On a side note however, have you considered using DEV arrays rather than combining your devices? There plenty of talk here on the forums on combining devices versus DEV arrays. Check out the usage of DEV arrays. One advantage to the array approach is that you can still control the devices individually.
Here's how you'd do it:
Though, I would change the feedback to take place in DEFINE_PROGRAM.
I think there's already been discussion on where to put and use touchpanel feedback. This way, if for whatever reason a panel goes offline, when it comes back online, the feedback is still good and the panel won't appear to be nonfunctional. This is also why I put my pop-ups in code - when it comes back online, it will go back to pages it was supposed to be on.
That's actually what I started out with, and that seems to work for the button events and feedback. But then I get a compile error when I try to use the device in a SYSTEM_CALL to control a DVD/VCR.
Are you referencing the array or the individual panels for the SYSTEM_CALL? My guess would be to reference the individual panel (i.e. dvTP1 or dvTP2) rather than any type of array (i.e. dv_TP or dv_TP[1]).
This slightly modified code should work fine.
Chuck
D'oh! - that's definitely a newbie mistake :-) Thanks for the help - it works great once I define the virtual device.
OK, I'm interested in this now. I've still got a button state initialization problem that's got me baffled. It's like the Mutually Exclusive doesn't pick up right away. Here's another (hopefully) relevant set of code snippets:
So... When the controller is rebooted, the panel comes up with button 1,40 in the ON state and 1,39 in the OFF state. But the first time I push button 39, it fails to turn off button 40. But once I push button 40 again, then the mutually exclusive works correctly. It just doesn't work the very first time.
It seems like I'm not initializing something correctly, but I don't know what. I'm wondering if moving the feedback down into the DEFINE_PROGRAM area as you suggested will fix my "First Time Mu/Ex doesn't work" problem.
Thanks!
No. It must be a virtual device. The virtual device brings along all the associations required. A variable or constant DEV do not.
Your online event fires when the virtual devices comes on line, which is significantly sooner than when the physical device comes on line, necessarily making it sooner than the combine itself is active. So your physical devices aren't necessarily getting the event when it happens. The exclusive property does not apply to the physical panel, just the virtual. You need to sync the startup conditions separately for each physical panel with individual online events for each. This is one of the reasons why I generally prefer a device array over a combine.
The online event posted in the code was tied to an individual panel, not the virtual panel, because I need to default each panel to a different page. Adding another data_event/online for the virtual panel and putting the on[vdvPanels,40] in the online event for the virtual panel actually fixed the 'first mu/ex not working' problem. Now on to my next bug...
Hi guys,
very old thread but I found this by searching some information for myself.
For combining panels you should use - as you wrote - COMBINE_DEVICES. You can also use DEFINE_COMBINE but that one is kind of a "static" combine. By using COMBINE_DEVICES and UNCOMBINE_DEVICES it is possible to combine and uncombine devices on the fly. It is not necessary to combine them in DEFINE_START section unless there isn't a specific need for some kind of a default combination after a system reboot.
For example, I have a project with multiple meeting rooms side by side. These rooms have a removable wall between them and it's possible to combine/uncombine the panels depending on the actual room combination.
You are still able to control the devices individually if you define the events and commands for real panels. Only the events and commands for virtual panels are distributed through the panels defined in COMBINE_DEVICE.
-Kari-