Updating workspace code for an identical touch panel
stopuz
Posts: 15
Hi All,
Our customer just requested that we program a second identical TP for a DGX16 system. Since I have already used DEV arrays and DEVCHANs in my code for one TP, I am confused now. How can alter the structure in the attached so a second TP (and if needed a third one in the future) can be added without duplicating the code?
Thanks,
Sinan
Our customer just requested that we program a second identical TP for a DGX16 system. Since I have already used DEV arrays and DEVCHANs in my code for one TP, I am confused now. How can alter the structure in the attached so a second TP (and if needed a third one in the future) can be added without duplicating the code?
Thanks,
Sinan
0
Comments
Another option might be to create another set of devchans for the new touchpanel, and just add Button_events for the new devchans to all the events you already have programmed for the old panel. You would also have to go through and add duplicate entries for all your feedback to the touchpanel.
rfletcher,
I'd appreciate it if you could take a quick look at the attached Main.axs file to see if that is the case for me?
Thanks,
Sinan
I don't see anything that jumps out at me as being a problem. Just keep in mind that if you want the two panels to always be on the same screen in addition to showing the same feedback you are going to have to turn on page notifications, and you may have to do some additional programming.
That would work too, though you would also have to either create a new dev array containing the two dvTP_Switch devices and then replace the device in your devchans with that array or make a second set of devchans with the new device and add button events with the new devchan above each of the existing button events.
Here's an example where I have an array of touch panels and an array of buttons.
If I want all the touch panels in the array to do the same thing I just address the touch panel array, or I can individually address each device in the array.
This beats combining touch panels because combining touch panels makes it impossible to have even a single button different. I often have multiple panels where most buttons are the same but a couple of buttons need to perform completely different actions.