Object Pm

Global object in the PROMOTIC system accessible by the Pm name.

The basic concept of VBScript and JavaScript languages makes them ideal for safe programming. For example the standard functions of the VBScript language include powerful instruments for algorithm creation, but do not offer any means cor connection with hardware environment. For example these do not allow writing to or reading disk, setting time, control I/O units, etc.
The best approach how to upgrade the JavaScript/VBScript language by functionality that language functions don't have, is to create objects that have the required properties and methods.
In the PROMOTIC system there is a large number of such objects (so-called Pma objects) that enable an access to databases, access for serial link and for Ethernet, calling of a DLL connection, etc.
By calling methods over the Pmg object we usually accomplish the status change of the concrete object (of this instance). It means that methods of these objects don't have global character.
In the PROMOTIC system there is one global object accessible directly from any hierarchical level of the tree. This object is accessible in the script by the "Pm" variable (i.e. calling in the script it is Pm.MethodName). The Pm object contains properties and methods that extend the functions set, for example, by writing to disk, time setting, data setting, etc.

Pm application properties and methods:
AlSoundEnable/disable sound notification of alarms
AppFullNamePath to the application with the application name
AppNameThe PROMOTIC application name
AppPriorityApplication priority
AppStopTermination of the application
AxGetObjectCreates a reference to ActiveX object
BeepReplay of the Windows OS system sound
CallAxMethodCalling ActiveX object methods in the JavaScript language
ClockStartStarting the time clock
ClockStopStopping the time clock
ColorOperVarious operations with defined color
ColorRgbReturns the color by entering the three RGB components
ControlSoundControls of the sound server of the PROMOTIC system
CreatePmActionCreates object of the PmAction type
CreatePmArrayCreates object of the PmArray type
CreatePmBufferCreates object of the PmBuffer type
CreatePmExprCreates object of the PmExpr type
CreatePmFormCreates object of the PmForm type (obsolete)
CreatePmFormatCreates object of the PmFormat type
CreatePmMapCreates object of the PmMap type
CreateProcessStarting the program (*.exe, *.com, *.bat) without waiting for the termination
CreateProcessSyncStarting the program (*.exe, *.com, *.bat) with waiting for the termination
DdeExecuteSending the command to the DDE server
EvalMacroEvaluation of the macro expression
FindViewersReturns the list of object viewers according to selected criteria
GetActiveWorkspaceReturns active PmaWorkspace object.
GetRtLangsReturns the list of all national languages supported in the application
GetSystemInfoReturns the system information
HttpFormDataParseParsing data from uploaded files
HTTPGetFormValueDecoding the text string delivered from the Web browser
JsonParseTransforms JSON format text into object, array or elementary value
JsonStringifyFrom object, array or elementary value creates text in the JSON format
LicenceInfoInformation about licences of the PROMOTIC application
MethodsAccess to global methods of the application
NetGetAddressReturns the computer local address in the network
NetTestPCTest whether the asked computer is accessible in the network
PlaySoundPlaying the sound file *.wav
RestartGuiExecutes restart of the application graphic interface
RtLangThe language version of the runtime application
ShellExecuteRunning or printing the file or the registered document
ShutDownShutdown of the Windows OS
WDogRefreshRefresh of the WatchDog program counter
WinEnviromentReadReading of environment variable
WinEnviromentWriteWriting into the environment variable
WndOperOperation execution over the opened window of another application
Pm properties and methods for users' administration (see Users and permissions):
AddUserAdds new PROMOTIC user
FindUserIdLocalReturns the identifier of the local user that refers to the entered login parameters
FindUserIdNetReturns the identifier of the network user that refers to the entered login parameters
GetUserInfoReturns the information from the user system
LoggedUserReturns the PmUser object, that represents the logged user
LogoffLogging off the logged local user without the query
LogonLogin of the local user without the input window
RemoveUserDeletes existing PROMOTIC user
TestUserInGroupTest whether the user is or isn't a member of the user group
WndEditUserPasswordDisplays the box for editing the password
WndEditUsersDisplays the window for editing the PROMOTIC users
WndLogoffDisplays the Logging off the user window
WndLogonDisplays the Logging on the user window
Pm methods for access to INFO system (see INFO system):
DebugText dump into the Debug item of the INFO system
InfoActionCalling the action over the item in the INFO system
InfoErrorAddWriting application errors into the "Errors/Application" tab in the INFO system
InfoErrorClearDelete the errors of defined type in the INFO system
InfoLogRegCreates new user tab in the Debug item of the INFO system
InfoLogAddWriting text into the user tab in the Debug item of the INFO system
InfoWriteToFileWrite the content of the INFO system tab into the text file
Pm visualization methods:
CreateViewObject for viewer opening
InputBoxEntering the value by the user
InputBoxForDateTimeWindow for entering date and time
InputBoxForFilePathWindow for the selection of the file/folder (obsolete)
MessageBoxDisplays the message in the window and waits for the user's click
PrintHtmlPagePrint or display the preview of the HTML page or text
PrintScreenPrint the whole screen to a printer or into the file
SelectionDialogIt allows to select the one option from the list in the input window (obsolete)
ShowHelpDisplays of help topic
Pm string methods (See also: VBScript string functions):
DecryptTextText decryption
EncryptTextText encryption
StringCmpReturns a result of a comparison of the two strings
StringCodeAtReturns the code of Unicode character on the definde position in the string
StringCodeFromReturns the character associated with the specified Unicode code
StringFindSearches the text for requested string from the defined position.
StringJoinReturns a string created by merging the substrings contained in 1-dimensional array
StringLenReturns the number of characters in the string
StringOperString operation
StringReplaceReplacement of the keyword in the string by the value
StringSplitReturns a 1-dimensional array of substrings
StringSubReturns the substring of another string
Pm date and time methods (See also: VBScript date and time functions):
CreateDateCreates date and time from its individual components
CreatePmDateObjectCreates the auxiliary PmDateObject object for working with date and time
DateAddReturns a date to which a specified time-span has been added
DateDiffReturns the number of time-spans between two dates
GetDateOfReturns dates from defined base date
IsDaylightTest of the "daylight-saving time"
TimeSystem time
Pm properties and methods mathematic and others:
AbsAbsolute value of a number
ArrayOperArray operations
AtanReturns the arctangent (invertetd tangent) of a number
CeilReturns the smallest integer greater or equal to a given number
CosReturns the cosine of an angle
EThe Euler's number (the base of natural logarithms)
ExpReturns the value of "e raised to the power of y"
FloorReturns the largest integer less or equal to a given number
GetBitReturns a value of the variable bit
GetVarTypeReturns the data type of the value
IsIntTest whether the value is integer
IsValidTest the validity of the value
LinearObtains the functional value (or the argument) of the linear function
LN10The natural logarithm of 10
LN2The natural logarithm of 2
LOG10EThe base-10 logarithm of e
LOG2EThe base-2 logarithm of e
LogNReturns logarithm of a number
PIPi number
PowComputes the value of "x raised to the power of y"
RandomReturns a random number in defined range
RoundReturns number rounded to a specified number of decimal places or whole places
SetBitChanging a bit of the variable
SignReturns an integer indicating the sign of a number
SinReturns the sine of an angle
SqrtThe square root of a number
SQRT2The square root of 2
TanReturns the tangent of an angle
ToNumberConversion to numeric value
TransformValueTransformation of the value
TruncReturns the integer part of a number (removes any fractional digits)
Pm disk/files methods:
DirCreateCreates the folder for files
DirExistTest the existence of file folder
DirRemoveDeletes the file folder
DiscGetFreeSpaceReturns the free space on the disk
DiscGetPathReturns the requested path (eventually also file name) in Microsoft format
DiscGetTotalSpaceReturns the disk capacity
FileCopyCopy of the file
FileCsvReadReading from the CSV file
FileCsvWriteWriting into the CSV file
FileDeleteDeletes the file
FileFindSearch for files and folders in the specified path
FileGetAttrReturns the file attributes
FileGetCreationTimeReturns the creation time of the file
FileGetLastAccessTimeReturns the last access time to the file
FileGetLastWriteTimeReturns the last write time into the file
FileGetLengthReturns the size of the file (in bytes)
FileMoveMove (rename) of the file (folder)
FileSetAttrSets the file attributes
FileTextReadReading of the text file
FileTextReplaceReplacement of text in the text file
FileTextWriteSaving the variable (or array of variables) into the text file
IniFileReadReading the item from the *.ini file
IniFileWriteWriting the item into the *.ini file
Obsolete properties and methods:
FormatDateCreates a text string containing date and time
ScanDateObtains date and time from text value
StringFormatWriting an array of values into the string
StringScanReading data from the string
AppQuitTermination of the application
BlinkerBlinking with the panel windows refresh period
CDblReturns an expression converted to the value of the Double type
CSngReturns an expression converted to the value of the Single type
CreatePmListCreates object of the PmList type
CpuUsageComputer CPU usage
FileBinaryReadReading the content of the binary file into the variable of the Array type
FileBinaryWriteSaving the content of the variable of the Array type into the binary file
FileReadVariableReading the value of the variable from the file
FileWriteVariableSaving the value of the variable into the file
InputBoxForStringSelectionIt allows to select the string from the list in the input window (obsolete)
MemoryUsageComputer memory usage
OtherAppOperOperation execution over the opened window of another application
RtLanguageThe language version of the runtime application (obsolete)
WndHtmlPageDisplays the HTML pages in modal/non-modal window
WndInfoWindow of the INFO system

Pm9.00.05: InfoLogReg and InfoLogAdd new methods: Methods allow registering a new item into the INFO system and then adding new entries into item. This is generalization of the Pm.Debug method for user defined logging.
Pm8.02.04: New constants were added that are used for mathematic calculations: PI, E, SQRT2, LN10, LN2, LOG10E and LOG2E.
Pm8.02.01: Many new methods were added that replace the original VBScript methods. These new methods are functional also in Web panels (JavaScript and VBScript). The new methods are:
- Pm.GetSystemInfo new method for detecting the resolution of the screen. It is functional also for Web panels.
- Pm.CpuUsage new property for detecting the load of the CPU.
- Pm.GetActiveWorkspace new method for detecting the active workspace (of the PmaWorkspace object). It can be used for example when creating multi display applications.
- Pm.PrintHtmlPage method: Fixed bug: the printing did not work in Windows OS 7.
PROMOTIC 9.0.23 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.