Overview of Structured Text Programming 
 
  Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018  645 
from cleared to set. The ABL instruction does not execute when tag_xic stays set 
or when tag_xic is cleared. 
 
In structured text, if you write this example as: 
IF tag_xic THEN ABL(0,serial_control); 
END_IF; 
The ABL instruction will execute every scan that tag_xic is set, not just when 
tag_xic transitions from cleared to set. 
If you want the ABL instruction to execute only when tag_xic transitions from 
cleared to set, you have to condition the structured text instruction. Use a 
one-shot to trigger execution. 
osri_1.InputBit := tag_xic; 
OSRI(osri_1); 
 
IF (osri_1.OutputBit) THEN 
ABL(0,serial_control); 
END_IF; 
 
Constructs can be programmed alone or nested within other constructs. 
If you want to  Use this construct 
Do something if or when specific conditions occur  IF. . . THEN 
Select what to do based on a numerical value  CASE. . . OF 
Do something a specific number of times before doing anything else  FOR. . . DO 
Keep doing something as long as certain conditions are true  WHILE. . . DO 
Keep doing something until a condition is true  REPEAT. . . UNTIL 
Components: Constructs