![GE PACSystems RSTi-EP Cpu Programmer'S Reference Manual Download Page 21](http://html.mh-extra.com/html/ge/pacsystems-rsti-ep/pacsystems-rsti-ep_cpu-programmers-reference-manual_123065021.webp)
Chapter 2. Program Organization
6
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
2.1
Structure of a PACSystems Application Program
A PACSystems application consists of one block-structured application program. The application
program contains all the logic needed to control the operations of the CPU and the modules in the
system. Application programs are created using the programming software and transferred to the
CPU. Programs are stored in the CPU’s non
-volatile memory.
During the CPU Sweep, the CPU reads input data from the modules in the system and stores the
data in its configured input memory locations. The CPU then executes the entire application program
once, using this fresh input data. Executing the application program creates new output data that is
placed in the configured output memory locations.
After the application program completes its execution, the CPU writes the output data to modules in
the system. This completes the CPU Sweep.
A block-structured program always includes a _MAIN block. Program execution begins with the
_MAIN block. Counting the _MAIN block, the program can contain up to 512 blocks.
2.1.1
Blocks
A block is a named section of executable logic that can be downloaded to and run on the target
controller. The logic in a block can include functions, function blocks and calls to other blocks.
2.1.2
Functions and Function Blocks
A function is a type of instruction that has no internal storage (instance data). Therefore, it produces
the same result for the same set of input values every time it executes.
A function block defines data as a set of inputs and output parameters that can be used as software
connections to other blocks and internal variables. It has an algorithm that runs every time the
function block is executed. Because a function block has instance data, that is it can store values, it
has a defined state.
The following table describes the types of instructions that make up the PACSystems instruction set.
Instruction Type
Instance Data
Examples
Functions
None
BIT_SEQ, ADD, RANGE
Built-in function blocks
WORD array.
TMR, PID_IND, PID_ISA
Standard function blocks
Structure variable. (Refer to
TP, TOF, TON
Note:
A user defined function block (UDFB) is a block of logic that can be called in your program
logic to create multiple instances of the block, allowing you to create a block of logic once
and reuse it as if it was a standard function block instruction. For additional information,
refer to
and
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...