"Hold" not letting go
Spannertech
Posts: 53
This is a gotcha for people like me who still occasionally come across the really old touchpanels. Trying a bit of test code, I found that it's possible, if you set the HOLD repeat time xx as in "HOLD [xx,REPEAT]:" to 1 (=0.1s), to have it keep on doing this event even after removing the finger off the button. This was a bit of a surprise!
DEFINE_EVENT
Data_event[dvPORT]
{
STRING: //parse string from port, display digits on TP
{
TEMPSTRING = DATA.TEXT
TEMPSTRING = MID_STRING(TEMPSTRING,24,4)
SEND_COMMAND dvTP,"'!T',1,TEMPSTRING"
}
}
BUTTON_EVENT[dvTP,dvBUTS] //ramp digits up or down
{
PUSH:
{
X = GET_LAST(dvBUTS)
}
HOLD [1,REPEAT]:
{
SWITCH (X)
{
CASE 1:
{
TEST++
SEND_STRING dvPORT,"'12345678901234567890123',ITOA(TEST),'XX'"
}
CASE 2:
{
TEST--
SEND_STRING dvPORT,"'12345678901234567890123',ITOA(TEST),'XX'"
}
}
}
}
I'm guessing this is happening because I've made the buss rather busy writing text back to the panel so it never sees the release?? I was using a very old TP (v1.52!). It doesn't do this with a G3 panel. It took me a while to guess it was the old panel causing the problem.
For testing I have the TX and RX of dvPORT tied together. I wanted to test some volume parsing code, which needs to go at this speed. When I made that hold time 2 or more, it worked as expected on the old panel. Actually I had to send the volume "nudge up or down" command, then followed by a status request to find out where it was. I think the receiver couldn't cope at a repeat time of .1s with getting two commands every .1s.
OP
DEFINE_EVENT
Data_event[dvPORT]
{
STRING: //parse string from port, display digits on TP
{
TEMPSTRING = DATA.TEXT
TEMPSTRING = MID_STRING(TEMPSTRING,24,4)
SEND_COMMAND dvTP,"'!T',1,TEMPSTRING"
}
}
BUTTON_EVENT[dvTP,dvBUTS] //ramp digits up or down
{
PUSH:
{
X = GET_LAST(dvBUTS)
}
HOLD [1,REPEAT]:
{
SWITCH (X)
{
CASE 1:
{
TEST++
SEND_STRING dvPORT,"'12345678901234567890123',ITOA(TEST),'XX'"
}
CASE 2:
{
TEST--
SEND_STRING dvPORT,"'12345678901234567890123',ITOA(TEST),'XX'"
}
}
}
}
I'm guessing this is happening because I've made the buss rather busy writing text back to the panel so it never sees the release?? I was using a very old TP (v1.52!). It doesn't do this with a G3 panel. It took me a while to guess it was the old panel causing the problem.
For testing I have the TX and RX of dvPORT tied together. I wanted to test some volume parsing code, which needs to go at this speed. When I made that hold time 2 or more, it worked as expected on the old panel. Actually I had to send the volume "nudge up or down" command, then followed by a status request to find out where it was. I think the receiver couldn't cope at a repeat time of .1s with getting two commands every .1s.
OP
0
Comments
Vinc
OP
Also, it is possible that the RELEASE event just isn't making it to the master for some reason. A HOLD is nothing more than a RELEASE after a specific time period following a PUSH. If the PUSH goes through but not the RELEASE, the HOLD is activated and never shuts off. This is common with the older RF Viewpoint panels.
If your repeated events eventually stop on their own, you have a buffer issue and need to increase the repeat time. If it goes on forever, but stops if you tap the button again, you are sometimes missing the release (in which case, if you can't fix the communications problem, you need to look at another way of doing it).