Promotic
WikipediaLinkedInYoutubeTwitterFacebook

How to use array of values in the PROMOTIC system

The PROMOTIC system allws to write algorythms in two scripting languages:
- VBScript and
- JavaScript (this can be used only in graphic item events meanwhile)
The array is used in a different way in each language. This chapter describes the usage of arrays in both languages.
 

VBScript

The array in this language is a standard VBScript array, i.e. Array data type.

The VBScript array functions can be used in order to work with this array.

 
The array can be created by using the Array method (for one-dimensional array), or by the Dim command (also for multi-dimensional arrays).

JavaScript

The array in this language is represented by the PmArray PROMOTIC object. This object is optimized for PROMOTIC system usage and allows to use 1- and 2-dimensional arrays.

The JavaScript language has its own Array object, but it is not recommended to use such object in the PROMOTIC system.

 
The PmArray object can be created by the Pm.CreatePmArray method.

Some other PROMOTIC methods using arrays

Pm.StringSplit - Returns a 1-dimensional array of substrings
Pm.StringJoin - Returns a string created by merging the substrings contained in 1-dimensional array
Pm.FileCsvRead - Reading from CSV file
Pm.FileCsvWrite - Writing to CSV file
Pm.FileTextWrite - Storing the variable (or the array of variables) into the text file
Pm.FindViewers - Obtaining he list of object viewers
Pm.GetRtLangs - Obtainig the list of all national languages supported by the application
Pm.ArrayOper - Array operations
Pm.TransformValue - Transformation of the value
 
PmData.GetVarArray - Create array of values from all object variables
PmData.GetVarSubArray - Create array of values from object variables specified by index (from-to)
PmData.SetVarArray - Assignment of values from the values array to the object variables
PmData.SetVarSubArray - Assignment of values array
 
PmDataTable.GetArray - Creating an array of values from selected data items of the object
PmDataTable.SetArray - Assignment of an array of values to the data items of the object
 
PmTrend.GetData - Getting the stored data
PmTrend.GetValueByTime - Getting the value (more values) of a variable (more variables) by the specified time.
PmTrend.SetValueByTime - Writing the value (more values) or a variable (more variables) by the specified time.
 
PmAlarmEvent.GetHistoryData - Getting the data from history of alarms/events
PmAlarmEvent.GetStateData - Getting the data from current state of alarms/events
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice