Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Variables - tab of the PmaRoot object

Description:
Definition of global variables and constants, that can be accessed in scripts directly by their names.

The form of this tab is common to more Pma objects and hence the common description is stated in the description of the "PmaObject > Data" tab.

 
Global variables on this tab are obsolete and it is better to use the variables in the PmaData object. Accessing the global variables is easy, but brings many disadvantages. For example are functional only in VBScript language, cannot be called in different thread (in the PmaSequencer object), etc.
Buttons:
Adding one or multiple new variables.
New variable - Opens the Variable window, where new variable can be added.
Multiple new variables - Opens the Multi items adding window, where any number of variables can be added.
Opens the Variable window, where the marked variable can be edited.
Deletes the selected variables.
Moves the selected variable upwards in the list.
Moves the selected variable downwards in the list.
Opens window for text search.
Opens menu with additional options.
Export to XML file - see Data export to the XML text file. Various export types to the XML file are described in Import/Export in the editor of Pma objects.
Export to CSV file - see Data export to CSV text file
Import from XML file - see Data import from XML text file
Import from CSV file - see Data import from CSV text file
Import from the OPC server - This item is available only in the PmaOpcDaClientGroup object. Opens the "Viewing the OPC server address space" window. On the selected level, it is possible to select multiple variables (by using the Ctrl, or Shift key), that are then added into this tab.
Sort - If sorts variables in the alphabetical order by the variable name. The order of variables is changed. Be careful in cases when variables are accessed not by the name but by index (order).
Data extensions - Opens the "List of data extensions" window, displaying a list of all found data extensions (defined anywhere in the application), designed for this specific target object (see the "Target object" configurator in the corresponding data extension).
Note:
Contrary to variables in other objects, the variable data type in this object can be set to Constant. This constant is then available as read only from all scripts. The constant data type itself is then defined by the data type of the evaluated initialization expression (e.g. true, false, 0, 1000, 1.33, "BoilerPlant1", etc.).
Example:
There is as defined global constant ccc and global variable vvv. There is the PmaData object with Number1 and Number2 data items. The value of the constant ccc will be written into the Number1 item. the vvv variable will be filled with the value of the Number2 item and then increased by 1.
JavaScriptVBScriptSelect and copy to clipboard

var oData = pMe.Pm("/Data");
oData.Item("Number1").Value = ccc;
vvv = oData.Item("Number2").Value;
vvv += 1;
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice