Loop Processing

If the created robot control program consists of multi-tasking and also have tasks with infinite loop, the system may become unstable and the connection with Epson RC+ may be disconnected.

The Controller detects infinite loop tasks. If the possibilities to affect the system are detected, the following error occurs and stops the program.
If the error occurs, modify the program and make sure not to set infinite loop.
Error code: 2556
Error message: An excessive loop was detected. Reduce the number of looped tasks or reset Wait

Do not perform any processing such as infinite loop or any other similar processing as much as possible.

Execute Wait command or a similar command in the loop processing and avoid occupying the CPU when performing calculation that requires loop or waiting for I/O signals.
It is not a problem if it is used in a loop that requires Wait commands such as the Wait command, robot motion command, Print command, and Wait Net command.

KEY POINTS


Infinite loop is performed in the following case:
When commands are created only with command without Wait in the loop such as operation instruction, assignment command, and I/O check command

Example 1: When turning the output port “2” on when input port “0” is on
Example of a program that may cause an error

               Do  
                  If Sw(0) = On Then  
                      On(2)  
                      Exit Do  
                  EndIf  
               Loop  

Correction example

               Wait Sw(0) = On  
               On(2)  

Example 2: When performing a large amount of calculations in a loop structure
Example of a program that may cause an error

               For i = 0 To 10000  
                   For j = 0 To 10000  
                       a = a + 1  
                   Next  
               Next  

Correction example

               For i = 0 To 10000  
                   For j = 0 To 10000  
                       a = a + 1  
                   Next  
                   Wait 0.01     ' Execute Wait to avoid occupying the CPU  
               Next