Scan Program

 

 

The Scan Program processes the regularly repeated signal for every scan.

Scan Program Properties

Program Name: Displays the name of the program.

Program ID: Decides the priority of program execution. Program is executed from ID with the lowest number.

Online Edit Buffer: Free space is reserved for the modification function while the program is running. If you keep editing online without downloading the program to PLC, the free space is reduced. Therefore, it is recommended that you secure the free space by reconfiguring the size of memory specified for downloading.

 

 

SUBROUTINE PROGRAM

 

The Subroutine Program is a collection of programs that are called by the “ECALL” command in the scan program. The scan program calls SBRT n ~ RET commands in the Subroutine Program according to the “ECALL” command.

For the “ECALL” command, a user enters Subroutine Program ID and its number. The result value of an instruction (Coil instruction, etc.) operating in the Subroutine Program is processed only when the Subroutine Program is called.

 

 

 

INITIALIZATION PROGRAM (COLD)

 

 

The Cold Start Initialization Program is executed when the power is supplied or CPU mode is switched from STOP to RUN mode. The Scan Program is executed after the Cold Start Initialization Program is complete. The Cold Start sets the initial data or initializes the peripheral and special module to run the Scan Program.

 

 

You must use the “INITEND” command to end the initialization program.

 

 

 

 

INITIALIZATION PROGRAM (HOT)

 

 

 

 [Menu] – [Tool] – [PLC Parameter] or [Project Window] – [Parameter] – [PLC Parameter]

 

 

 

 

Enable the Hot Restart function in the PLC Parameter Window and set the time. This function will be executed only if the temporary power failure occurs within the setting time.

 

If the power fails temporarily within the setting time and the Hot Restart function is enabled in the PLC Parameter,

the Hot Start Initialization Program is executed to keep previous values before the power failure and to successively execute a scan program.

You must use the “INITEND” command to end the initialization program.

 

 

 

 

 

 

PERIODIC INTERRUPT PROGRAM

 

The Periodic Interrupt Program is executed at intervals specified by Interrupt Period.

 

 

 

 

How to Configure the Interrupt Program

 

Specify the Interrupt ID from 0 to 15. The ID number cannot be duplicated.

Free space is reserved for the modification function while the program is running. If you keep editing online without downloading the program to PLC, the free space is reduced. Therefore, it is recommended that you secure the free space by reconfiguring the size of memory specified for downloading.

 

The program with the lowest Interrupt ID gets a higher priority and will be executed first.

 

Enter the Interrupt Period that will execute the program by the specified intervals.

 

If you want to run the Interrupt Program, use the “GEI” command to enable the usage of the program.   Then, execute the program using the “EI” command.

 

 

 

  • For XPnB CUP type, Interrupt Program is executed automatically if it was registered previously.

  If Interrupt feature is disabled by using command “DI” on XPnB CPU type, then command “GEI” must be used to enable the Interrupt feature again.

  For all CPU types except XPnB, these two commands “GEI” and “EI” are used to enable and execute an Interrupt Program.

  • The interrupt program ends with the IRET instruction.

 

 

 

Program Operating Principle

 

 

 

 

The Initialization Program operates only during the early stage of PLC operation whereas the Scan Program operates repeatedly as long as the PLC is running.

The Subroutine Program is executed only when it is called out by the “ECALL” command during the Scan Program.