Page 1 of 1

repetitive operation

Posted: Sat Jun 13, 2020 7:45 am
by OPT-Liuxm
Hi,

For example,Within an hour,I perform an action every five minutes, can I do it in a code loop?

As shown in the figure, You can see that I copied and pasted the same thing, which is a little inconvenient.In case it takes too long to set up, it's too complicated to copy and paste.

Thank you all. :D

Re: repetitive operation

Posted: Mon Jun 15, 2020 6:43 am
by odklizec
Hi,

Of course, you can do that, for example with "For" loop.

Code: Select all

for (int i = 0; i < 11; i++) // loop 12 times (12x5m = 1h)
{
    GetMessage();
    Delay.Seconds(300);
}

Re: repetitive operation

Posted: Tue Jun 16, 2020 6:48 am
by OPT-Liuxm
Yes, very good.
The For loop is done. :D