How do you pause an animated button?
Joe Hebert
Junior Member
Is there anyway to pause and then restart a multi-state general button that has Auto-Repeat set to Yes and feedback always on. The ^ANI command works great and I?m assuming that?s the command I need to use but I can?t figure out the params to use to make it pause.
Since 0 for state means current state, I tried plugging in a 0 for both the start state and the end state but that doesn?t do anything except to stop the animation when it reaches the last state (which is not what I would have expected since Auto-Repeat is Yes and feedback channel is always on)
So then I tried a 1 for start state and a 0 for end state and as expected that makes the button flicker between the first state and the current state (an almost pause)
I also tried turning the feedback channel off but that didn?t do anything for me either.
Any ^ANI experts out there that can help me out?
TIA
Software History wrote:"'^ANI-<variable text address range>,<start state>,<end state>,<time>'"
Run a button animation. Time is in 1/10 seconds and is optional.
0 for state means current state.
Syntax:
SEND_COMMAND <DEV>,"'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
Since 0 for state means current state, I tried plugging in a 0 for both the start state and the end state but that doesn?t do anything except to stop the animation when it reaches the last state (which is not what I would have expected since Auto-Repeat is Yes and feedback channel is always on)
So then I tried a 1 for start state and a 0 for end state and as expected that makes the button flicker between the first state and the current state (an almost pause)
I also tried turning the feedback channel off but that didn?t do anything for me either.
Any ^ANI experts out there that can help me out?
TIA
Comments
-
animated button control
Joe,
I was banging my head against the wall with using multi-state buttons
for animations a while back. At that time, I was trying to find a way to
query the button for the current state. This is not possible, just for the
reasons you stated in your post.
I ended up emulating the "always-on" feedback through code. It seems
as the feedback type property falls into the group of properties that
override any code commands. Once it is set a specific way in TPD4,
it cannot be modified by external commands.
Now, if I need to have any control over the multi-state button, I just
send ON and OFF commands when applicable. -
In my particular situation, I don?t care what the current state is. I just want to send a command to pause the animation at whatever the current state happens to be. I tried your suggestion of changing the feedback to channel and then turning the channel off and on via code, however, that didn?t get me any further in trying to figure out how to pause.
Are you saying you have been able to pause an animated button? If so, can you explain how? I?m getting nowhere fast.
Thanks. -
I dont think this is possible with a multistate general button.(someone correct me if i'm wrong?)
You could use a multi state bargraph with some timeline code to achieve it though. Put your animation states into the multistate bargraph and give it a high range equal to your maximum number of states. Create a repeating timeline and in each timeline event send a level incremented by one to your bargraph, Loop it back to 0 when you reach your bargraph high range.Now on a button event on your bargraph pause your timeline with 'timeline_pause'. You can restart it with 'timeline_restart'. This will achieve what you're trying to do. -
animation control
I should have clarified, I was NEVER able to get a multi-state button
to pause mid-stream during an animation.
The multi-state bargraphs are nice for level control, but apparently dont
have the ability to auto-repeat by themselves.
It sounds like a custom timeline would probably be the way to go.
I am hoping that in the near future, these touch panels will support more animation type effects natively, without writing special code for it. -
Thanks for the suggestion. Yes, I?ve considered that alternative, however, in my case that will generate way too much unnecessary traffic as the animation is going to run continuously (unless it is paused ? which apparently can?t be done) and my code will have to send level commands non stop. The best part about the animated button in conjunction with the ^ANI command and other formatting commands is that I can control and modify the animation and generate very little traffic. All the hard work is done on the touch panel side of life with a minimal amount of strain on the Netlinx program and the network.dbrady wrote:You could use a multi state bargraph with some timeline code to achieve it though.
I guess I?m going to have to abandon the idea of pausing. Feature request?
Thanks for the feedback guys. -
I don't have the time to try this out right now, but if you created a timeline that fired at the same frequency of the button animation, you could simply start the timeline when you turn on the button. The timeline would simply keep track of the current button state. In the event you need to pause the button, just grab the current state and send the ^ANI with the start and stop frames set to the current frame. This should be able to do what you want. You may have to turn off the channel before issuing this command, but from my experience recently with the ^ANI command, this should work. Oh, don't forget to give the button an address code or the ^ANI command won't work

Jeff -
Any Updates?
Has anyone made it work? -
Pausing Animations
This is what I've used for stopping animations as well as changing speeds, etc. I guess what you want is to stop where ever you are in the animation vice at the end of the run which is what it appears to always do. I had to double check this one and it does indeed finish its run before stopping. I did have mine set to "Always On" and Repeat "yes".
The timeline idea peviously mentioned would probably be the only way to stop where it is but as you said that would always be running in the processor where I guess the animation runs on the TP independent of the processor once initiated.
Here's what I've used FYI:
{
push:
{
local_var integer nAniB
nAniB = button.input.channel
switch (nAniB)
{
case 1://high speed
{
// paddle fan animation
//"'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
send_command dvAni_Array,"'^ANI-1,1,7,1'"
}
case 2://medium speed
{
send_command dvAni_Array,"'^ANI-1,1,7,2'"
}
case 3://low speed
{
send_command dvAni_Array,"'^ANI-1,1,7,6'"
}
case 4://stop
{
send_command dvAni_Array,"'^ANI-1,0,0,0'"
}
//walking man animation !!!!!!
//"'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
send_command dvAni_Array,"'^ANI-2,1,20,10'"
}
case 5: //running man
{
send_command dvAni_Array,"'^ANI-2,1,20,23'"
}
case 6://walking man
{
send_command dvAni_Array,"'^ANI-2,1,20,50'"
}
}
}
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
