Points to note about repetitive processing

<< Click to Display Table of Contents >>

Manual > Screen Creation Guide > Script > Script Example > Script Tips >

Points to note about repetitive processing

Points to note about repetitive processing

The FA-Panel script has two loop statements, "for" and "while". By using these, you can write loop processing smartly.

 

However, when writing a repetitive process, be careful not to create an "infinite loop." If an infinite loop occurs in a script, it can affect system operations, such as preventing control from being passed to other processes.

 

•An example of an infinite loop
 

While(1)

{

if(this.GetVal(“Tag01”) == 1) break; //Wait until Tag01 becomes 1

}

 
In the above example, the loop cannot be exited until the value of Tag01 becomes 1. Please avoid writing processing like this. When writing a loop, write it in such a way that the end condition is always guaranteed.