Hi all, I'm trying to perform an action (send an HTML POST command) ONLY every 5 seconds. I can't do it. can you help me?
unfortunately this is not what I wanted. maybe I explained myself badly. I would like that:
- the action that is launched by pressing button1 is launched only if more than 5 seconds have passed since the previous press.
- if the button is pressed within 5 seconds from the previous press, a message appears saying "wait 5 seconds ..." Thank you very much
Ah, that is quite different
Let us see if we can come up with a solution for that. The easiest way would be to disable the button for five seconds, using a clock timer. You could change the text on the button to inform the user when it is ready to go again.
Try this (not tested)
When button is pressed the update is started and button disabled so it cannot be pressed again, until a) the previous request completes, b) five seconds is counted
You may want to add something for when the request fails (response code does not equal 200)
it works almost perfectly, but there is a problem. at the first click of the button, after the initialization of the screen, the action does not start, it is in fact in the waiting phase of 5 seconds. after the first click, waiting 5 seconds, then it works.
Please state which example code you are referring to Marco - TimAI2 or rnareshu?
rnareshu
This work perfect tnks
It is working to me as per the problem defination, I have not included the web call etc.
- On start it is Green
- On click it become Red for atleast 5 seconds
- If clicked after 5 seconds it become Green again, and so on
TimeFrame.aia (3.6 KB)
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.