omron — 4-1-1 Program Structure

4 Implementation Example of Dynamic Pick-and-place Equipment 4-1 Program Specifications for Dynamic Pick-and-place Equipment An example of a program is provided below. The variable ebool_exet1 is a flag that indicates that the V+ program is executable. The sequence control program monitors the status of this variable, and starts automatic operation when the V+ program is ready to run.

.PROGRAM supervisor() EXTERNAL e_is_run_mode, ebool_exet1 AUTO REAL p_is_run_mode GLOBAL $ip $ip = "127.0.0.1" p_is_run_mode = e_is_run_mode WHILE TRUE DO IF e_is_run_mode THEN IF TASK(1,3) 4 THEN EXECUTE 3 control() END 4 ebool_exet1 = TRUE ELSE IF TASK(1,3) 0 THEN 4-1-1 Program Structure ABORT 3 CYCLE.END 3 KILL 3 END IF p_is_run_mode THEN BRAKE CALL px.stop() END END p_is_run_mode = e_is_run_mode WAIT END .END  Regular Processing Program (control) Regular processing program is a program that performs a routine processing. If it fails to start, it automatically restarts.

The routine processing includes the process of writing values of V+ digital I/O signals to the shared variables with the sequence control program. A program is described below. .PROGRAM control() EXTERNAL e_conveyor_run EXTERNAL e_conveyor_spd EXTERNAL e_conveyor_dir WHILE TRUE DO e_conveyor_run = SIG(2001) e_conveyor_spd = SIG(2002) e_conveyor_dir = SIG(2003) 4-9 NJ-series Robot Integrated System Startup Guide (O049)