Waits problem
alanh
Posts: 30
I have been using a stack var to allow me to select one of my 6 identical devices, allowing me to use the same transport buttons, but i now need to send muliple commands to one of the devices, i need to utilise the stack var if poosible as otherwise i will need to revisit all the previous code, obviously waits are not allowed when using stack variables as shown below
BUTTON_EVENT[VIEW_209_TP,9] // playback last recording
{
PUSH:
{
STACK_VAR INTEGER F
F = GET_LAST(SELECT_PANEL6_DVR)
SEND_STRING PANEL_6[F], "'@00:DR:FP:32:N:*'"
wait 05
{
SEND_STRING PANEL_6[F], "'@00:DR:MN:*'" //MENU
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 02
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 02
{
SEND_STRING PANEL_6[F], "'@00:DR:RI:*'" //RIGHT
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:EN:*'" //ENTER
}
}
}
}
}
}
}
}
}
Any help in this matter would be greatly appreciated.
Thanks
BUTTON_EVENT[VIEW_209_TP,9] // playback last recording
{
PUSH:
{
STACK_VAR INTEGER F
F = GET_LAST(SELECT_PANEL6_DVR)
SEND_STRING PANEL_6[F], "'@00:DR:FP:32:N:*'"
wait 05
{
SEND_STRING PANEL_6[F], "'@00:DR:MN:*'" //MENU
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 02
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 02
{
SEND_STRING PANEL_6[F], "'@00:DR:RI:*'" //RIGHT
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:DN:*'" //DOWN
WAIT 03
{
SEND_STRING PANEL_6[F], "'@00:DR:EN:*'" //ENTER
}
}
}
}
}
}
}
}
}
Any help in this matter would be greatly appreciated.
Thanks
0
Comments
The stack_var is deallocate from the memory right after the end of the event, in this case, the push.
With Local_var variables, the processor will maintain in memory for later use.
You can have more details in the netlinx keywords help
Regards,
The structure item timeline.id will be very useful in this instance as well.
But I have to wonder if the waits are necessary in the first place. What kind of device is this? I think you might benefit more from creating a buffer so you can send them all at once, and let your buffer handler pace the execution.
Paul
Now's a good time to mention putting code samples in [ code ] CODE [ /code ] (no spaces) tags will format everything correctly and not produce smileys...
That said, does button 10 get you 30 men when playing two player?
Kevin D.