Sending On/Off from TPdesign
adys
Posts: 395
Hi all
I am trying to send an ^ANI command from the TPDesign CommandOutput field.
If the button is declared as a multi state button, its working. If its as a general button, its not, even that I use states 1 and 2 only.
how can I send on/off commands from this field to a general button?
I don't want to change my buttons just for this, and I don't want to do it in code.
Thanks
Adys.
I am trying to send an ^ANI command from the TPDesign CommandOutput field.
If the button is declared as a multi state button, its working. If its as a general button, its not, even that I use states 1 and 2 only.
how can I send on/off commands from this field to a general button?
I don't want to change my buttons just for this, and I don't want to do it in code.
Thanks
Adys.
0
Comments
What are you attempting to achieve by sending the command from the button instead of through code. It's seems to me to be a convoluted way of doing anything.
Other than the obvious method through code I don't see any other way of changing the button state from the TP other than using a send_level. If you don't want to switch from general to mulit state to use the "ANI" command I doubt you'll want to change to a multistate bar graph and try a send_level command. If it even works from there.
maybe he wants to have a touchpanel that has nice looks, but still works offline? AMX uses this for all their demo panels too. You can program the loopback port to use all the commands you can use from code
I never want a touch panel to work when the master is offline. I've never thought about that. I would think that would make troubleshooting a bit more difficult.
Interseting...
Demo units for the sales people to cart around and show off to potential customers.
So there is no way for doing it?
Tp me it looks bad to open popup in one place and handle the button state in another, and I don't want to open the popups in code...
If I can send simple buttons states commands from the TP - why not?
Think about the folowing example:
I have a button that open a small speakers mapping popup and becoming red. When another button pressed on this screen he close the speakers screen and the button becomes white again. (On/Off)
Its so simple to do it from the TPDesign, why do I need to write a BUTTON_EVENT code, handle full of states and scenarios from all the places that need to close this screen (a lot) instead of doing it in TPDesign + I can see it in preview and debug all scenrios in preview time?
Just all the buttons are general now and I wanted to know if there is anyway to change a state of a button from the TP...
BTW - how can I ask for a buttons state from my code?
thank again guys
Adys
Another reason would be that button feedback is not always driven by the user pushing a button on the touchpanel. If you are reporting when a light is turned on, what happens if someone turns off the light from a different touchpanel or from the switch itself? If your feedback is driven from the touchpanel, there is not an easy way to update the touchpanel and it will often display the wrong states.
I even handle my popup control from the program so that it becomes very apparent when pushing a button on the touchpanel will do nothing. This is a matter of personal preference and opinion of course.
I just reread your post and as for viewing button states in your program, it is easy. [DEVICE,CHANNEL_NUMBER] is a true/false indication of the channel state. For example,
Another reason to handle things in code is that it is generally easier to make changes in code than in the touchpanel files, especially if you start using mulitple touchpanel files and multiple touchpanel screen formats.
Jeff
I would have to back up Jeff on the button feedback, though. I recently had a project with 12 touch panels, all crossing over each other controlling the same devices. If one TP user does not know what another user is doing or has done, it can lead to very irritating phone calls.