Delay with tcp commands


Hi everyone
im really need your help
im using the app to control my smart controller
im trying to make a delay between two commands
you can see in the picture that im tried to make a process of:
1.check recieved data - if contains - wait 10sec - check again - if true show yyy.png - else show yyy.png.
from some reason its not working
it does change the .png when the controller feedback the right command but not with the delay the i told him to wait.

please help me

23ad163d9bd4022dc57caad152545474926dfb9d_2_690x323

You are setting the Clock Timer Interval to 51 years (the number of milliseconds from 1970 to the present datetime.) + 10 seconds.

Just set it to 10 seconds (10000 ms.)

You will need a Clock1.Timer event block to do the Picture changing for after the 10 second timer fires.

so the first ste is to change the "call -clock1-.systemtime" to "call-clock1-now"???

can you show me lease where i can find clock1.timer event block??

yes that i know, but i cant add this command string to the "when TCPclient data recieved" group.
please someone can build it and upload an image?
what i want to do is when a command feedback from my controller come - if its contain the right feedback then start timer of 30 seconds for examle and test again if the same command appear again - if true = show .png
if false = show other .png file.

Keep an extra global variable called feedback_deadline, initially 0.
When you do something that requires checking if 30 seconds has passed, set it to 30000 + SystemTime.

Each time you want to check if you have passed a deadline, compare Clock1.SystemTime against each deadline variable.

If (SystemTime > the variable) and (the variable > 0), you have passed a deadline, and must

  • announce the deadline has passed and
  • reset the deadline to 0

P.S. Here is a sample app with deadline variables ...