Projects and Files

In GPL, rather than executing a "program", a "Project" is the basic executable entity. Console commands are provided for loading, compiling, and executing a Project.  A Project consists of two or more text files that are stored within a single disk folder (directory).  Each file is a standard human-readable ASCII file.  The folder name and the Project name are synonymous.

The file "Project.gpr" must always be present in each project folder and is referred to as the "Project File".  This file contains information on the other files within the Project including which program is invoked when the Project begins execution. Each GPL source file has a "gpl" extension.  These files each can contain one or more modules, which in-turn can contain multiple variable declarations and procedures. A Project can also contain one, several or no files with a "gpo" extension.  This type of file contains a global module that is used to defined global Location and Profile objects.   This file is convenient for storing taught robot locations and general motion Profiles that are accessible by all procedures within the Project.

Loading a Project into memory or copying a Project from memory or between disk units is equivalent to copying a file folder and all of its contents.  Multiple Projects can be present in memory although only one Project can be executed at any given time.

Modules

Only modules can be found at the outer-most level of a file. [In the future, class declarations will also be allowed]. These modules contain variable declarations such as Public, Private, and Dim statements, or procedure declarations such as Sub or Function statements. A procedure or module-level variable can be accessed by fully specifying its name using the syntax:

module_name.variable_name
              -or-
module_name.procedure_name

Within a single module, all procedures and module-level variables can be freely accessed. However, only Public procedures and variables in other modules can be accessed. If Public variables or procedures with the same name are found in two different modules, they can only be accessed by using the fully-specified name, to disambiguate the multiple definitions.

Executing a Project

Before a Project can be executed, it must be loaded into memory and compiled.  The steps are as follows:

  1. Load the Project and associated files into memory.
  2. Issue a compile request for the Project.
  3. Issue a start request for the Project.

The Project begins execution at the "start" procedure specified in the Project File (Project.gpr). Note that the start procedure must be declared Public.