Home AMX User Forum AMXForums Archive Threads AMX Applications and Solutions

AMX Widgets Notes and Messenger not working properly

Has anyone tried the AMX Widgets Notes and Messenger available here
http://www.amx.com/ui/browse.asp?uiType=Widgets&panelClass=&market=&resolution=&panelType=&aspectRatio=

The code and touch panel samples uses the port 1 for the address and channel port . Now i have modified the define device section for the port i wanted which was anything more than 1.

DEFINE_DEVICE
MessengerTP1 = 10002:2:1
MessengerTP2 = 10003:2:1
MessengerTP3 = 10006:2:1
MessengerTP4 = 10014:2:1

But if i change the port to anything other than 1 in the touch panel and the code , it will not work . Even though i checked the address port, channel port and the code based on the port no i have put.

I have attached the notifications tab when i run the messenger widget with a port of 2. The commands are going but the widget will not function. I have also attached my code and TPD4 file so that you can verify if i am coding and touch panel design is proper.

Comments

  • DHawthorneDHawthorne Posts: 4,584
    It probably depends on STRING events from the panel, and those only report on port 1. There is nothing you can do about it. I suppose it's also possible that they hard-coded the module to port 1 ... which would be really sloppy of them. I think it's the former.
  • RE: widgets and port 1...

    The previous post was correct, the string events are received on port 1. If you change the device port number you will no longer receive the string events. There are only a handful of address and channel codes being used in the example files, if you are already using these codes in your project the easiest remedy would be to change these in the widget code and panel file.
  • Or you can create a separate device definition for the text input. For example
    DEFINE_DEVICE
    dvTPTxtInput1           =  10001:1:1
    dvTPTxtInput2           =  10002:1:1
    
    
    dvTPNotes1              =  10001:2:1
    dvTPNotes2              =  10002:2:1 
    
    
    DEFINE_CONSTANT
    DEV dvTPTxtInputs[]     = {dvTPTxtInput1,
                               dvTPTxtInput2
                              }
    
    DEV dvNotesPanels[]     = {dvTPNotes1,
                               dvTPNotes2
                              }
    
    DEFINE_EVENT
    DATA_EVENT[dvTPTxtInputs]
    {
         STRING:
         {
            // ...parse,parse,parse in this section
            //
            SEND_COMMAND dvNotesPanels,"'^TXT-101,0,',DATA.TEXT"
                 ON[dvNotesPanels,4]                                                       //turn on new msg indicator
         }
    }
    
    BUTTON_EVENT[dvNotesPanels,3]//ERASE
    {
         PUSH:
         {
             SEND_COMMAND dvNotesPanels,"'^TXT-101,0, '"
             OFF[dvNotesPanels,4]//turn off new msg indicator
         }
    }
    

    I would change the button name on the text input button so that you know the string event is coming from the "notes" page.

    --John
  • John PaulJohn Paul Posts: 143
    thanks for the posts guys, my queries are

    1. How can they hard-coded the module to port 1 since there is only a netlinx code and not a TKO file or anything .


    2.How do i modify the messenger widget.
  • viningvining Posts: 4,368
    John Paul wrote:
    1. How can they hard-coded the module to port 1 since there is only a netlinx code and not a TKO file or anything .
    They can't. Dave just assumed that the module was an A-Typical module with the cool parts locked up inside the .tko and w/o the un-compiled .axs it was made from.

    This widget doesn't have that so it doesn't apply.
    2.How do i modify the messenger widget.
    You basically have to do what John G. said and create a TP device on port 1 to handle strings from the TPs and then forward those strings to your code for the widget. Usually you create a virtual for the widget to receive the string from the TP device created for port 1 data event string handler.

    If you get confused just post again and some one will help out with more example if need be but the previous post by John G had the basic idea already coded.
  • John PaulJohn Paul Posts: 143
    vining wrote: »
    John Paul wrote:

    They can't. Dave just assumed that the module was an A-Typical module with the cool parts locked up inside the .tko and w/o the un-compiled .axs it was made from.

    This widget doesn't have that so it doesn't apply.


    .

    Since the widget is not hardcoded to port 1 , why am i not able to change the port to another no and still receive the strings. Is it because i am using the setup port to receive the strings or using data.text, just curious thats all.
    vining wrote: »
    John Paul wrote:


    You basically have to do what John G. said and create a TP device on port 1 to handle strings from the TPs and then forward those strings to your code for the widget. Usually you create a virtual for the widget to receive the string from the TP device created for port 1 data event string handler.

    If you get confused just post again and some one will help out with more example if need be but the previous post by John G had the basic idea already coded.

    Regarding using a virtual , is it like creating a virtual and passing the strings on its command part of the data event and then doing the parsing.

    I have a audio media server on port 1 and about 27 touch panels and it would have been so simple to just change the port in the code and do it.
  • viningvining Posts: 4,368
    John Paul wrote:
    Since the widget is not hardcoded to port 1 , why am i not able to change the port to another no and still receive the strings. Is it because i am using the setup port to receive the strings or using data.text, just curious thats all.
    Strings from TPs only arrive on port 1, that just the way the panels work so any dev port that sends string to the master send the string to port 1.
    Regarding using a virtual , is it like creating a virtual and passing the strings on its command part of the data event and then doing the parsing.
    Yep. the only thing is you need to have a way of determining where the string is coming from in order to dertermine where to forward it so like John suggested it's easiest to copy the pop up and modify the name of the text input button since that gets pre-pended to the string that arrives at the string event handler of port 1. Do a select active with findstring(data.text,'some_name_Keypad',1) and then send command dvVirtual, data.text . Then in the command data event handler for the virtual device parse your string.

    It's really not that difficult.

    Here's a thread with some info:
    http://amxforums.com/showthread.php?t=5906
Sign In or Register to comment.