Programs
Overview
A program is comprised of screens which, in turn, encompass controls and processes. A program can also contain routines and local procedures.
The programs, as well as the program elements are displayed in a tree view located in the "Programs Module". Whenever there is an addition to the project or program, it is displayed in that tree view.
If you add a program via an import and that program is locked, its content will not be displayed in the tree view, only its name. A "locked" program means it is not editable.
There are two types of programs, the Main Program and Application Programs.
Main Program (A)
The Main Program is, automatically, generated when the project is created.
This is the program that starts the application in the device. It generally contains a menu that allows the operator to access most or all of the other programs( application programs) in the application.
One large Main Program, with all the application's functionalities, can be created, without, actually, using other application programs. However, recommended best practice is to design and manage projects with multiple programs, each managing a functional application aspect.
A project can contain only one Main Program. The Main Program ("P:Main") is the only program that CANNOT be renamed or deleted.
Application Programs (E)
The Application Programs can have, virtually, any functionality. They enable the operator to perform certain tasks and communicate with the host, as well as with peripherals.
Detail of a Tree View
The "Programs" module organizes the project's elements (programs, screens, global/local procedures, routines, controls, etc.) into a tree view. This provides a perspective of the project's architecture but also allows access to the displayed elements - it is possible to add, edit, delete or define the properties of the elements being displayed (ex: the right-click of an element in the tree view provides a menu with related options).
A – Main Program
B – Screen “Screen_1” (within the Main Program)
C – Routine “Routine_3” (within the Main Program)
D – Local Procedure “Local_Procedure_1“ (within the Local Procedure Group in the Main Program)
E – Application Program “Login”
F – Screen “Screen_1” (within the Application Program “Login”)
G – Routine “Routine_1” (within the Application Program “Inventory”)
H – Local Procedure Group (within the Application Program “Inventory”)
I - Locked Element "P:Inventory_1 (identified with a |
Typical Program Components
Screens (B, F)
Screens are more than a set of controls. They contain the coded commands (processes) that carry out the actual program work, as well as the variables that store the application data and other controls. Screens provide the interface between the operator and the application.
Routines (C)
Routines contain commands (processes) that are executed as needed. They are usually called with a "Go To" Branch Process (ex: "Go to R: Routine_1") but can only be used in screens within the program they were created in.
Routines can also call other routines and local procedures within that same program or global procedures.
Local Procedures (D, H)
Local Procedures contain commands (processes)."In" and "Out" parameters are defined with the aid of variables. Local Procedures can only be implemented/called from screens within the program that contains them. They are called with a “Call Local Proc” Branch Process. See Working with Call Local Proc Process.