Home AMX User Forum AMX Design Tools

Buttons don't work when transfered from other design files?

alecgalecg Junior MemberPosts: 30
(Preface, I'm new - thank you for your help!)

This is a weird one for me:
I have a UI that I've built with various Channel Ports for my various devices.
dvTP1 = 10002:1:1 //Core Buttons
dvTP2 = 10002:2:1 //DVD Controls
dvTP3 = 10002:3:1 //Cable TV
dvTP4 = 10002:4:1 //Phone & Volume Controls
dvPolycomRPTp = 10002:5:1 //Realpresence

I'm using the PolycomRP Duet Module which I wrote into my code EXACTLY like they wrote their demo (or so I believe). I first loaded their demo UI, and my entire system controls BEAUTIFULLY.

Then, I opened up my UI, copied a few buttons into it, and changed the Channel Port to the one that matches my devices. Feedback works! Control does not??? I push mute on the UI, nothing happens. I push mute on the device itself, the button on the UI reverses!!!

As always, any insight is very much appreciated!

***Side note: What I changed on the buttons was the Channel Port & the Address Port from 1 to 5. I also tried each one individually. When I changed to Address port only, I got no control OR feedback.


  • John NagyJohn Nagy CineTouch Product Manager Posts: 1,654
    When something that was copied exactly does not behave as the original, find the error in the copy.

    Since you seem unsure, the CHANNEL codes are for pushes; they are what the panel tells the Master, CONTROL.
    The ADDRESS codes are the means by which the code in the master can talk to the graphics in the panel, FEEDBACK.
  • HARMAN_ChrisHARMAN_Chris Harman Integrated Technologies Group (ITG) Posts: 443
    Consider the channel numbers to be the ones causing actions to occur. The address numbers are used to show/hide a button as well as use code to write text on the buttons. The port number is in place to allow you to reuse a number, but still differentiate it from the other buttons using the same number. Some programmers like to split these groupings, like in your example, across multiple ports because it feels cleaner. However, as your system size grows in terms of the number of touch panels, you will want to keep the port usage down to a minimum because of the resource allocation occurring in the background when these are used. Additionally, you should avoid skipping ports - for the same reason. The Netlinx master will reserve memory for the worst case usage based on the ports that come online from a touch panel. If you have 5 ports, it will reserve memory allocation for every button and level possibility for each port. If you skip between port 1 and then use port 12 for instance - it will reserve memory for all of the ports in between, even if you do not intend to use them. This effect is multiplied per panel, so in larger systems, it can become quite taxing for a NI master. This effect is minimized to some extent with the higher memory in the NX Master. Many senior programmers will leverage as many channels as possible within a single port and use button channel arrays to manage groups.

    As for your question, John is correct, something is off in the configuration. My first look would be at the UI definition in your program. Are you using a UI module or just the communications module for the device? If you turn ON button press notifications, and then press one of your audio conference buttons, what D:P:S number is reported back?

    This issue falls into an area where forum members need to see the code to understand where it is going wrong. You can either attach your file to the post, or you can use syntax found here http://www.amxforums.com/misc.php?do=bbcode to add a code tag to your post which will allow you to paste code into your post and preserve most of your formatting.
    [ code ] <paste your code here> [ /code ] (delete the spaces)
  • John NagyJohn Nagy CineTouch Product Manager Posts: 1,654
    The OP states that his code ran correctly when using the demo UI, but then when he adapted the TP file to his need, it no longer worked. No code change so I think the thing that changed is the thing that changed it.
  • alecgalecg Junior Member Posts: 30
    I figured out what I'm doing wrong, but I'm not sure how to make it right!

    If I define my touchpanel as dvTP1 10002:1:1 everything on this duet module works.
    If I define my touchpanel as dvTP1 10002:5:1 everything on this duet module fails.

    I was under the impression that changing the TP port allows for multiple SNAPI modules to co-exist despite using the same channel numbers.

    Probably this is just my ignorance showing.

    I would be very grateful for a little light to be shed on this for me!
  • alecgalecg Junior Member Posts: 30
    Okay, now I'm even MORE confused, lol!

    If I push channel 520, which is not documented in SNAPI or in the Word doc that came with the module, that activates something. After I've sent that channel command, the buttons start to work. This also works if I change port numbers. I came to this method after picking thru the TP4 with a lot of scrutiny.

    In short, I figured out how to make it work.

    In long, why? What is this? How does this work? Is programming in AMX with duet modules just being relegated to trying to reverse engineer someone's undocumented black box tricks?

    Please, someone give me some insight because this whole process has been ridiculous!
  • DHawthorneDHawthorne Old Timer Posts: 4,584
    On a guess, it looks to me as the module is expecting something from the panel on port 1, and it internally sends whatever command you are triggering on channel 520 when it sees it. Maybe an online event? Perhaps they even put that channel 520 thing just for what you are doing, but neglected to document it. But in any case, someone was trying to be slick, and all it really managed was to break (somewhat) the portability.
  • alecgalecg Junior Member Posts: 30

    What that basically means is I have HOURS of trial and error in front of me.

    That sucks.
  • alecgalecg Junior Member Posts: 30
    Okay so if anyone else is following this thread, I want to update what I've learned.

    A lot of Duet Modules are written with a sample UI attached. There is typically a nav menu and sub pages with specific buttons on them, and if you simple copy the buttons into your own UI, they won't work because their ability to function is married to their sub-page being "active". Which pages are tied to which buttons is spelled out in your DEFINE_VARIABLE, and the behavior of the activation and deactivation is spelled out in the "ComponentInclude" Include. Each subpage in turn has certain rules that are spelled out in its respective module that is also loaded into that UI. You have to pick thru all of this stuff to get your buttons to work.

    OR, you can build your buttons from scratch and ONLY use the .jar and the SNAPI codes from the SNAPI guide which are far less functional, but far more likely to get you where you're going (at least as you're starting out).

    Also, note that all of the variable, dev, and such names are generic, so if you're planning on loading multiple modules you'll need to pick thru each to make sure you're not doubling up on nomenclature.

    I'm starting to recognize that the more I know, the less I know.

    If anyone has tips, tricks or can point me at a thread that helps me, I am very grateful for your guidance.
Sign In or Register to comment.