Use
You define variables if you want to transfer the value of a message characteristic to another process instruction.
You can define variables in the following cases, for example:
Variables in entries to refer to the values to be entered
See also: Type 0: Definition of Entries
Variables in calculations to refer to the values to be calculated
See also: Type 0: Definition of Calculations
Variables that refer to characteristics whose values are assigned automatically
Variables in dynamic function calls to refer to the import parameters that are transferred to the PI sheet;
See also: Type 0: Definition of Import Parameters
Variables in dynamic function calls to refer to the table parameters that are transferred to the PI sheet;
See also: Type 0: Definition of Table Parameters
You can define a variable for every message characteristic of a process instruction. The data type of the variable is identical to that of the message characteristic (for example, CHAR or NUM).
The following types of variables are distinguished:
Simple variables
Can only be used in the same PI sheet or cockpit in which they were defined
You use characteristic PPPI_VARIABLE.
Global variables
can be exchanged as follows:
Between different PI sheets of the same process order
As data points using the internal interface Manufacturing Data Access:
Between PI sheets of different process orders
Between PI sheets and cockpits (in the same frameset)
Between different cockpits (in the same frameset)
You use characteristic PPPI_GLOBAL_VARIABLE.
For more information on Manufacturing Data Access , see:
You define a simple variable by assigning the following characteristic to the process instruction immediately before the message characteristic whose value you want to transfer to the variable:
Characteristic |
Meaning |
Value |
PPPI_VARIABLE |
Simple variable that can only be used within one PI sheet or cockpit |
New variable name |
Example
Example of simple variables
The simple variable VAR is defined for the input value “material quantity”. The value of variable VAR is to be displayed somewhere else in the PI sheet.
Process instruction 0010:
PPPI_INPUT_REQUEST |
Material quantity |
|
PPPI_VARIABLE |
VAR |
|
PPPI_REQUESTED_VALUE |
PPPI_MATERIAL_QUANTITY |
Process instruction 0020:
PPPI_OUTPUT_TEXT |
Material quantity |
|
PPPI_OUTPUT_VARIABLE |
VAR |
You define a global variable by assigning the following characteristic to the process instruction immediately before the message characteristic whose value you want to transfer to the variable:
Characteristic |
Meaning |
Value |
PPPI_GLOBAL_VARIABLE |
Global variable that can be exchanged between different PI sheets and cockpits |
New variable name |
Example
Example of global variables
A totals calculation is to be executed in cockpit PMC1. The global variable VARSUM was defined for the value calculated.
The value of variable VARSUM is to be read in cockpit PMC2 as a data point using Manufacturing Data Access and transferred to the simple variable VARLC. The value calculated is to be displayed in cockpit PMC2.
Caution
This functionality is available for two cockpits or for one cockpit with a PI sheet in the same frameset only.
Cockpit PMC1:
PPPI_INPUT_REQUEST |
Calculate value |
|
PPPI_GLOBAL_VARIABLE |
VARSUM |
|
PPPI_CALCULATED_VALUE |
PPPI_MATERIAL_CONSUMED |
|
PPPI_CALCULATION_FORMULA |
VAR1 + VAR2 |
Cockpit PMC2:
PPPI_DATA_ACCESS |
Manufacturing Data Access |
|
PPPI_BUTTON_TEXT |
Read value from PCM1 |
|
PPPI_FUNCTION_DURING_DISPLAY |
Permitted |
|
PPPI_IMPORT_DATA |
PMC:0001.PMC1.VARSUM |
|
PPPI_STRING_VARIABLE |
VARLC |
|
PPPI_OUTPUT_TEXT |
Value calculated |
|
PPPI_OUTPUT_VARIABLE |
VARLC |
Note the following:
In general, you can choose any name for a variable. To avoid conflicts with other functions, do not use:
Variable name X
Variable names that start with SY_ since these are system variables predefined by SAP
Blanks and arithmetic operators as part of the variable name
The following character strings at the end of the variable name:
_< number >, for example, _1, _2
_ COUNT
_ SUM
For more information, see Using Variables in Browser-Based PI Sheets and Cockpits .