Global, valid up to end of main program (V.P.)

The identifier "V.P. ....” permits the definition of self-defined variables which are detected (global) at the current program level and at all other program levels but are not valid after main program end. V.P. variables may be assigned values in REAL format. As of Build V2.11.2032.08 declarations of other data types with initial values are possible.

V.P. variables can also be created as multi-dimensional arrays. A maximum of 4 dimensions is possible, e.g. V.P.TEST[1][2][3][4].

Syntax:

V.P.<FREE_DEF>

global variable not valid after (main) program end

<FREE_DEF>

User-defined name consisting of any number of characters (excluding blanks, tabulators, comments, comparison operators, mathematical operators, square brackets).

Programing Example

prg_example

Global variable not valid after (main) program end (V.P.)

Create V.P. variables with and without assigning data types and initial values.

:

#VAR

  V.P.VAR_1                           ;REAL64, 0.0

  V.P.VAR_2 : UNS32 = 200             ;UNS32, 200

  V.P.VAR_3 : REAL64 = 11.34          ;REAL64, 11.34

  V.P.VAR_4 : STRING[20] = “END_OK”   ;STRING, END_OK

  V.P.VAR_5 = 20                      ;REAL64, 20.0

#ENDVAR

:

XV.P.VAR_5        ;X20.0

:

The maximum number of self-defined V.P. variables is fixed [6]-6.21. At program start, all names and values of V.P. variables are deleted.