Switch case within a hold statement
ryanww
Junior Member
So I have a block of code that I am using below.. I am unable to activate anything within the hold portion of the button event. I just ended up writing a new button event for the 10 buttons that I have in this situation. Why is it though that it wouldn't work?
Thanks,
Ryan
BUTTON_EVENT [dvTP,0]
{
PUSH:
{
SWITCH (BUTTON.INPUT.CHANEL)
{
CASE 1: { } //DO SOMETHING HERE
}
}
HOLD[20]:
{
SWITCH (BUTTON.INPUT.CHANEL)
{
CASE 1: { } //DO SOMETHING HERE
}
}
}
Thanks,
Ryan
BUTTON_EVENT [dvTP,0]
{
PUSH:
{
SWITCH (BUTTON.INPUT.CHANEL)
{
CASE 1: { } //DO SOMETHING HERE
}
}
HOLD[20]:
{
SWITCH (BUTTON.INPUT.CHANEL)
{
CASE 1: { } //DO SOMETHING HERE
}
}
}
Comments
-
The only thing I find odd, is doing a SWITCH..CASE on 0. Not sure if that's messing it up. I'm doing a SWITCH..CASE on a HOLD event in code right now, works fine. Try defining the BUTTON_EVENT's channels. Please report back.
Note: Just to clarify, I *do* know that BUTTON_EVENT[dvTP,0] is perfectly legal. -
The way I understand BUTTON_EVENT[dvTP,0] is that Push: and Release: are valid but Hold: is not valid.
Pauld -
Oh, I guess if I used a devchan or chan array, it probably would have worked. Its only a couple buttons, so I am not too worried.. Just wondering though..
Thanks,
Ryan -
did you copy/paste direct from your code? Because you're trying to act upon button.input.chanel, instead of button.input.channel
J -
Whoops, I thought you were talking to me... I removed my message explaining my misspelling. However, I then found I had spelled it correctly and you were speaking to someone else.
-
Hope you didn't say anything mean to Jeff in your pre-deleted post. You might find one of those interdiction Coast Guard gunboats near your officesericmedley wrote:Whoops, I thought you were talking to me... I removed my message explaining my misspelling. However, I then found I had spelled it correctly and you were speaking to someone else.
.
--John -
John Gonzales wrote:Hope you didn't say anything mean to Jeff in your pre-deleted post. You might find one of those interdiction Coast Guard gunboats near your offices
.
--John
No, there was nothing mean at all. I actually made a self-depricating joke but then realized that it wasn't directed at me in the first place. So, the joke would then not make sense. -
Not just one bug
The results of some research using an NI700 on v2.29.218 and NS2 on 2.5.0.163 with a G3 browser panel emulating a touchpanel and also using "Emulate a Device".
Here is the code that illustrates the problem:program_name='fred' define_device dvTP = 10810:1:0 define_event button_event [dvTP,0] { push: { send_string 0,"'push[',itoa(button.input.channel),']'" } hold[10]: { send_string 0,"'hold[',itoa(button.input.channel),']'" } }
The push is fine but the hold sees a value for button.input.channel of 0.
If I push twice within a second, I see an error message on the NI telnet:
"CIpHold::AddHold - Duplicate"
I see a single hold after every push no matter how brief the push.
If I change tobutton_event [dvTP,164]
everything is OK. -
Yea.. that was just my horrible spelling cuz I was in a hurry.. That wasn't copy and pasted.
But that is what I did.
Thanks, Ryan
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