Panel Commands
jason_the_adams
Posts: 108
Hey all,
I'm relatively new to programming AMX, but not to programming as a whole, so I understand how things work from that end. Presently, however, I'm trying to do some testing in which sending button commands to some panels are involved - simple enough, right?
I'm running into the problem that when I use the following syntax:
At this point, I thought to myself that the syntax I was dealing with might be old; perhaps new commands use the "@" character. Problem is, when I went to find something new in AMX PI, I found nothing; not only that, but I couldn't even find the @TXT command in any of the Touch Panel documentation - which is the only command I can get working.
...Help!
I'm relatively new to programming AMX, but not to programming as a whole, so I understand how things work from that end. Presently, however, I'm trying to do some testing in which sending button commands to some panels are involved - simple enough, right?
I'm running into the problem that when I use the following syntax:
SEND_COMMAND dvTPANELS[LAST_PANEL],"'@TXT',SOMEBUTTON,'Some Text'"...It works just fine. However, when I do this:
SEND_COMMAND dvTPANELS[LAST_PANEL],"'^TXT',SOMEBUTTON,2,'Some Text'"- that syntax does not work for me. Furthermore, I have the same problem when trying to use the ^BMF command to disable and hide some buttons.
At this point, I thought to myself that the syntax I was dealing with might be old; perhaps new commands use the "@" character. Problem is, when I went to find something new in AMX PI, I found nothing; not only that, but I couldn't even find the @TXT command in any of the Touch Panel documentation - which is the only command I can get working.
...Help!
0
Comments
I think I see the problem. Look very carefully at the documentation and you will see that the entire "Command" is a string. The 2 (and the commas around it), which indicates the state, needs to be a string as well. So, this should work:
also this
So, the use of the command is a little goofy in that everything, including the punctuation, needs to be part of the string, and integers need to be characters, not integers.
SEND_COMMAND dvTPANELS[LAST_PANEL], "'^TXT-',ITOA(buttonLow),'.',ITOA(buttonHigh),',',ITOA(buttonState),',',Some more text)"
regards
gary
The @TXT command documentation can be found in the info for G3 panels. @TXT is actually the older 'outdated' command but it still works with G4 panels.
I don't think that will work Harold. Did you mean this?
I was thinking it was more the commas that were the issue, but you are right, he has the commas on either side of the 2 so ,',2,', is correct. I was fooled since I don't usually write it that way. I keep my commas separate from the string in case it gets changed from a hard coded value to an interpolated value like so.
Believe it or not I find that easier to read
Paul
While I'm asking syntax questions, however, I do have one more inquiry into the collective forum mind...
Is there a way to tag a keyboard/keypad string with a custom prefix? For example, have the string from the keyboard return with 'KEYB-2:Stuff from keyboard'? Alright, technically that's a suffix, but you know what I mean.
Thanks y'all!
In TP4 click File then Open System Page Template
Copy the __keyboard or __keypad and name the new one MyCustomKeyPad or whatever you want.
in this new keyboard/keypad that you have created click on the text box and rename KEYB- to AMXKeyB-.
Then instead of using the inbuilt open keyboard command you just use a PPON-MyCustomKeyPad to open your custom keypad.
Make as many as your touchpanel can support.
Does the keypad/keyboard send the string specifically to that device and port? Say there's multiple touch panels; does the string go to the master, and therefore the panel which sent the string needs to be tracked, or will the string show up within the DATA_EVENT for that specific panel?
Thanks!