Predefined local variables

Every script contains some predefined variables. All predefined variables are declared as constants, so they may not be changed from the script.

Value Group of local variables Value type Meaning
QUERY action
0 _Q_YES INT Positive response to an action.
1 _Q_NO INT Negative response to an action.
2 _Q_TIMEOUT INT Exceeded the maximal wait time on action.
3 _Q_DONTKNOW INT Response to an action.
Variables describing an error
- _ERR_LINE INT Line, where the error occurred.
- _ERR_NR INT Error number.
- _ERR_NR_TRANS_EX INT Extended error number - list of existing errors.
- _ERR_MSG TEXT Error message.
Database opening parameters
1 _DB_READ INT ''Read only'' access to the database.
2 _DB_MODIFY INT ''Modify'' access to the database.
Parameters from process D2000 HI
- _FROM_HIP ALIAS If the script is started from process D2000 HI, then the variable contains the reference to the given process.
- _HIP_PAR_STR TEXT If the script is started from process D2000 HI, then the variable contains the parameter declared during event linking.
- _HIP_USER_DESC TEXT If the script is started from process D2000 HI, then the variable contains the name of logged-on user. After logging off the user and then logging on the other one to D2000 HI, this variable is updated.
Error codes
0 _ERR_NO_ERROR INT No error.
1 _ERR_EXPRESSION_STATUS INT Undefined value.
2 _ERR_EXPRESSION_TYPE INT Invalid value.
3 _ERR_NO_ASSIGNED_ALIAS INT Unassigned ALIAS.
4 _ERR_EXEC_EVENT INT Script execution failed.
5 _ERR_RETURN INT Unexpected RETURN.
6 _ERR_LOCAL_VAR_NFOUND INT Unknown local variable.
7 _ERR_LOCAL_VAR_NOT_RECORD INT Local variable must be a structure.
8 _ERR_OBJECT_NFOUND INT Unknown object.
9 _ERR_ARCHIV_NOT_RUNNING INT The archive is not running.
10 _ERR_TRANS_ABORT INT Transaction abort. Synchronous operation is broken.
11 _ERR_TRANS_ERROR INT Transaction error. Synchronous operation is not started (process is not running).
12 _ERR_TRANS_IGNORED INT Transaction ignored. Synchronous operation is not accepted (e.g. invalid parameters).
13 _ERR_EVAL_ERROR INT Error during the expression evaluation.
14 _ERR_RANGE_ERROR INT Limits overrun.
15 _ERR_NO_ALIAS INT ALIAS is required.
16 _ERR_NO_RECORD INT Value must be a structure.
17 _ERR_RECORD_NO_COMP INT Structures are not the same type.
18 _ERR_INVALID_OBJ_TYPE INT Invalid object type.
19 _ERR_VALUE_RANGE INT Value out of the range
20 _ERR_INVALID_HANDLE INT Invalid handle.
21 _ERR_LOCAL_MUST_PUBLIC INT Local variable must be PUBLIC.
22 _ERR_NO_DATA INT No data.
23 _ERR_MORE_DATA INT More data available.
24 _ERR_TIME_OUT INT Timeout.
25 _ERR_UNKNOWN_REFID* INT Unknown graphic object.
26 _ERR_INVALID_REFID_TYPE* INT Invalid type of the graphic object.
27 _ERR_MISSING_RETURN INT RETURN or END ProcedureName is missing in the procedure.
28 _ERR_SERVER_REQUIRED INT Attempt to call a remote procedure of system event, that is not declared as Server Event in the configuration.
29 _ERR_PROCEDURE_NOT_FOUND INT Attempt to call a remote procedure that does not exist.
30 _ERR_INV_NUM_PARAMS INT Incorrect number of parameters when calling the procedure.
31 _ERR_SET_CONST INT Attempt to change a constant value on the place of input-output parameter.
32 _ERR_FILE_ERROR INT Error during running the actions:
   DB_READ_BLOB - new file creation or modification is disabled
   DB_UPDATE_BLOB - file reading is disabled
   IMPORT_CSV - file reading is disabled

33 _ERR_JAVA_EXCEPTION INT Error at calling JAVA RPC procedure.
Called procedure terminated in exception.
34 _ERR_OBJECT_IS_NOT_IN_ARCHIVE INT
  • archive manipulation actions enable to specify archived object instead of archive object.
    This condition cannot be verified during saving ESL script therefore this error occurs when the object is not archived during this action.
  • this error can also occur if limits (row) are exceeded in reference to structured archive.
35 _ERR_DATABASE_ROWS_LIMIT INT

Actions DB_READ, DBS_READ, SQL_FETCH or SQL_SELECT required to read and the database table contained more rows than the limit specified by the parameter Maximum returned rows defined on the Database object.

36 ERR_IS_RECORD INT Defined value may not be a structure.
37 ERR_DEADLOCK_RPC INT Detection of ESL script deadlock when synchronous calling the RPC procedures between the scripts. If the deadlock occurs, the execution of script will be finished.
Access rights
0 _ACC_NONE INT No access
1 _ACC_READ INT "Read only" access
2 _ACC_CONTROL INT "Control" access - value setting
3 _ACC_MODIFY INT "Modify" access
Priority for storing into the log database
0 _LOG_PRTY_INFO INT Information
2 _LOG_PRTY_WARNING INT Warning
3 _LOG_PRTY_ALARM INT Alarm
4 _LOG_PRTY_CRITALARM INT Critical alarm
5 _LOG_PRTY_ERROR INT Error
Row and column of the trigger value change during script start
- _TRIGGER_ROW INT Position of change: row
- _TRIGGER_COL INT Position of change: column
Constants for specification of statistical function for the action CALCSTATFUNC and for functions D2_CalcStatFunc and D2_CalcStatFuncArr
1 _STAT_F_AVG INT Arithmetical average
2 _STAT_F_WGAVG INT Weighted average
3 _STAT_F_INTEGRAL INT Integral
4 _STAT_F_SUM INT Sum
5 _STAT_F_MAX INT Maximum
6 _STAT_F_MIN INT Minimum
7 _STAT_F_COUNT INT Count
8 _STAT_F_FILTER INT Filter
9 _STAT_F_INCREMENT INT Increment (Compare value is 1.0)
10 _STAT_F_DELTA INT Delta (Compare value is 1.0)
11 _STAT_F_ECOAVG INT EcoAvg
12 _STAT_F_GT_TIME INT GT Time (>)
13 _STAT_F_GE_TIME INT GE Time (>=)
14 _STAT_F_LT_TIME INT LT Time (<)
15 _STAT_F_LE_TIME INT LE Time (<=)
16 _STAT_F_MAXT INT Interval maximum
17 _STAT_F_MINT INT Interval minimum
18 _STAT_F_NUMPEEKS INT Number of local maxima
19 _STAT_F_SUM_POSITIVE INT Sum of positive values
20 _STAT_F_SUM_NEGATIVE INT Sum of negative values
21 _STAT_F_AVG_POSITIVE INT Arithmetical average of positive values
22 _STAT_F_AVG_NEGATIVE INT Arithmetical average of negative values
23 _STAT_F_ADDITION INT Sum of increments (Compare value is 1.0)
24 _STAT_F_TIMESLICE INT Time slice
25 _STAT_F_NUMPITS INT Number of local minima
27 _STAT_F_SAMPLE_DEV INT Sample standard deviation
1000 _STAT_F_ADDITION_PARAM INT Sum of increments
1001 _STAT_F_INCREMENT_PARAM INT Increment
1002 _STAT_F_DELTA_PARAM INT Delta
Constants for specification of integral size for the action CALCSTATFUNC and for functions D2_CalcStatFunc and D2_CalcStatFuncArr
1 _INTEGRAL_HOURUNIT INT Hour integral
2 _INTEGRAL_MINUNIT INT Minute integral
3 _INTEGRAL_SECUNIT INT Second integral
Events class for log database. Application in functions %HI_OpenLogDBByMask and %HI_OpenLogDBForObject.
1 _LOGF_ALARM INT Alarms
2 _LOGF_SYSTEM INT System
4 _LOGF_PROCES INT Processes
8 _LOGF_KOM INT Kom
16 _LOGF_OPERATOR INT Operator intervention
32 _LOGF_EVENT INT Events
64 _LOGF_LOGONLOGOFF INT Log on / Log off
128 _LOGF_MANUALENTRY INT Manual intervention
256 _LOGF_CHANGEVALUE INT Impulsive value change
512 _LOGF_POSTMORTEMDATA INT Time recorder

* Errors may be occurred only in an active picture.

Napíšte komentár