TO statements that occur outside PUSH...
vegastech
Junior Member
I am turning on a channel (button channel) on a touchpanel for feedback purposes, within a hold button, and get the following warning on compile:
WARNING: RSB, Rev2.axs(1290): C10608: TO statements that occur outside the data flow of PUSH events/statements may not work
WARNING: RSB, Rev2.axs(1290): C10608: TO statements that occur outside the data flow of PUSH events/statements may not work
HOLD[2,REPEAT]:
{
IF (nLightVal[get_last(dcLightsUpBtns)]<100)
{
//feedback on button press
TO[dcLightsUpBtns[get_last(dcLightsUpBtns)]]
//start incrementing variable for that zone
nLightVal[get_last(dcLightsUpBtns)]++
//Update the Level on the Touchpanel
SEND_LEVEL dvTPLight,(GET_LAST(dcLightsUpBtns)+9),(nLightVal[get_last(dcLightsUpBtns)]*255/100)
}
ELSE
{
//Set value to 100%
nLightVal[get_last(dcLightsUpBtns)] = 255
}
The idea here is to program a button to show pressed while it is being held. The button itself is not set up in the touchpanel as momentary feedback, which is why I programmed it this way. Is there a better way to do this so as not to get the aforementioned error? BTW, every time I press the button(s) associated with this code, it works fine. Possibly a variable or channel going high (or set to 1) during a push, and then to 0 on the release, with feedback in define_program? Comments
-
All you need is a TO[BUTTON.INPUT] inside the PUSH.The idea here is to program a button to show pressed while it is being held. -
First of all, it's just a warning. I have a project where I stuck it inside a function that was called by a button press, and it worked flawlessly, despite the warning. It's just that you can't guarantee the globals used by the TO statement aren't going to change on you in the meanwhile.
That said though, in your case, it's easy enough just to take it out of your HOLD and put in in the PUSH handler ... even if you have to add a PUSH just for that purpose. There is no need at all to put it in a HOLD; it kind of creates its own HOLD internally. -
I figured that was the case(just a warning...), but just wanted to be sure, or at least, 90% sure.
Thanks for the button.input - there are so many handlers that I haven't quite figured out yet!
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