PAscript requires the definition of all libraries and variables, to be used in your code.

Variables that are used in the test are defined on the Global Variables tab. Additionally required local variables are defined on the Local Variables tab. All libraries you want to include are declared on the Libraries tab.

Namespaces Tab

In the Namespaces tab, you can reference both libraries and namespaces that you want to use in your state machine. Libraries and namespaces are created in PAconfigurator and included in the code with the using keyword.

The subsequent access to public elements of the library is done in the code directly by specifying the library name followed by a colon and the name of the public element. For global classes, however, you must first create an instance of this class as a local variable.

To open the Namespaces tab, click in the Explorer on the Namespaces node. List all namespaces and libraries that you want to use in the state machine. The individual elements of a namespace are separated by a colon.

Global Variables Tab

Define all variables in the test that you use in the code as global variables.

  1. In the Explorer, click the Global variables node. The Global variables tab opens.
  2. Enter all of the global variables that you want to use in the state machine.
Figure 68. Code Window for Defining Global Variables
Tip The selection list proposes existing names when defining global variables.

Local Variables Tab

You must define all counter variables for loops, auxiliary variables etc. that are not present in the test as local variables. You must also call the constructor function of global classes for instantiation with the local variables. Enter the complete namespace followed by the class name as the data type.

In the Explorer, click the local variables node to open the Local Variables tab. Enter there all the global variables that you want to use in the state machine.

Figure 69. Code Window for Defining Local Variables

Functions Tab

In PAgraph programs, too, you can define functions that are only valid in this single program. Click the Functions node in the Explorer to open the Functions tab, then enter the code for the function body.

Figure 70. Code Window for Defining Functions