From OpenSCADAWiki
Functions
- Generic processing of the raw analog input for:
- simple correction-calibration at the formula "in = iMult*(in+iAdd)";
- scaling from the hardware border [plcMin...plcMax] to the main border [min...max], applying the square scale scSqr;
-
The hardware borders can be inverted ones and disabled in whole for equal values of the maximum and minimum, when the main border only used.
- permission to exceed the border for the input value on the value of plcExcess percent;
- filtering the input value changing in the time Tf.
- Simple imitation of the analog input, setting plcImit and linking the imitation-simulation source in plcImitIn.
- Complex preprocessing and complete generation-imitation of the analog input on the internal programming language of OpenSCADA into the configuration IO inProc (with appending the builtin syntax highlight rules), where you can operate next service parameters:
- in [IN|OUT] — the same raw analog input IO;
- var [IN] — the end variable IO;
- min, max [IN] — the main border IOs;
- plcMin, plcMax [IN] — the hardware border IOs;
- plcImit, plcImitIn [IN] — IOs of the simple imitation;
- levErr, tErr [IN|OUT] — alarm level [-79...0] and text of the error (the attribute "err" format);
- f_frq [IN] — frequency of calculation, the template IO;
- this [IN] — reference to the parameter object, what executing the template;
- ctx [IN] — object of the user context, what saved between the execution cycles;
- args [IN] — object of arguments of the procedure;
- toSave [OUT] — to force save the parameter object at exit.
- Simple substitution for the variable subVar at the error (not valid) input variable (EVAL) in the modes: "no", "last" and "substitute".
- Processing the result variable var for violation some borders and criteria, generating the alarms and proper setting the attribute err. The alarm borders can have some hysteresis HystBnd, can be delayed on the time alDelay and can be suppressed setting alSup. Next borders and criteria are provided:
- missing for data or connection with source at the EVAL input value — error code 1 and alarm level 5;
- exceeding the input value of the hardware border — error code 1,2 and alarm level 5;
- exceeding the end variable of the alarm border [aMin...aMax] — error code 3,4 and alarm level 4;
- exceeding the end variable of the warning border [wMin...wMax] — error code 5,6 and alarm level 2;
- big motion speed of the end variable — error code 7 and alarm level 2.
- Specific parameters redefinition in the common attribute DESCR:
- the first line — as description of the alarm messages;
- the field CustomFlds — specifying of the custom fields of the alarm messages in the form "CustomFlds: {CustFld0} => {CustFld1} => ... => {CustFldN}";
- the field CustomAlarms — redefinition of the standard alarm levels of the alarm messages in the form "CustomAlarms: {ConErr};{BrdAlarm};{BrdWarn}".