Panel Commands
jason_the_adams
Junior Member
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!
Comments
-
jason_the_adams wrote: »...
...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.
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:send_command dvTP, '^TXT-123,2,TEXT'
also thissSomeButton = "itoa(nButtonNumber)" SEND_COMMAND dvTP,"'^TXT-',sSomeButton,',2,','Some Text'"
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. -
You can do this as well:
SEND_COMMAND dvTPANELS[LAST_PANEL], "'^TXT-',ITOA(buttonLow),'.',ITOA(buttonHigh),',',ITOA(buttonState),',',Some more text)"
regards
gary -
jason_the_adams wrote: »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!
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. -
sSomeButton = "itoa(nButtonNumber)"
SEND_COMMAND dvTP,"'^TXT-',sSomeButton,',2,','Some Text'"[/code]
I don't think that will work Harold. Did you mean this?sSomeButton = "itoa(nButtonNumber)" send_command dvTP,"'^TXT-',sSomeButton,',',itoa(2),',','Some Text'"
-
Originally Posted by Hedberg
sSomeButton = "itoa(nButtonNumber)"
SEND_COMMAND dvTP,"'^TXT-',sSomeButton,',2,','Some Text'"
Unless I'm reading it wrong, the code that Hedberg posted looks fine to me. He's got the 2 inside of single quotes so it's already ASCII.I don't think that will work Harold. Did you mean this?sSomeButton = "itoa(nButtonNumber)" send_command dvTP,"'^TXT-',sSomeButton,',',itoa(2),',','Some Text'"
-
Joe Hebert wrote: »Unless I'm reading it wrong, the code that Hedberg posted looks fine to me. He's got the 2 inside of single quotes so it's already ASCII.
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.send_command dvUis[ui], "'^TXT-',itoa(zoneChannel),',',itoa(0),',',cZoneDesc[iRoomZones[room][j]]"
Believe it or not I find that easier to read
Paul -
Different strokes for different folks, you won?t get an argument from me.Believe it or not I find that easier to read
-
Definitely appreciate everyone's help; I got the issue resolved.
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! -
Yes.
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. -
Vielen Dank, filpee, and Last question (potential lie):
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! -
It will show in the data_event for each individual panel
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums