Promotic

SetValue - method of the PmVar object

Description:
Writing the value, quality and time of the source simultaneously.
Syntax:
Empty SetValue(Variant vValue, [Long nQuality], [Date tTimeSource])
Parameters:
vValue(Variant) The new value to be written.If null is entered, then the value is not changed. Allows to enter a new quality or source time without changing the value.
nQuality[optional] (Long) New written value quality. If not specified, then the quality is not changed.
tTimeSource[optional] (Date) New written source time. If not specified, then the source time is not changed.
Note:
Caution! If the variable uses the quality or time of the source in addition to the value, then it is recommended to change the variable (value, quality and time of the source) simultaneously using this method. This avoids successive individual writes (value, quality and time of the resource) to the variable.
See also:
- PmVar.Value (property)
- PmVar.Quality (property)
- PmVar.TimeSource (property)
Example1:
Value setting (50) and quality (192 (&hC0)). This is the setting of the value and good quality (e.g. after successful communication).
JavaScriptVBScriptSelect and copy to clipboard

var oVar = pMe.Pm("/Data").Item(0);
oVar.SetValue(50, 192);
Example2:
Keeping the original value (null) and setting the quality 20 (&h14). This is the setting of a bad quality value (e.g. after communication loss).
JavaScriptVBScriptSelect and copy to clipboard

var oVar = pMe.Pm("/Data").Item(0);
oVar.SetValue(null, 20);

History:
Pm9.00.18: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.