datahub_writedatahub_write — assigns a value to a DataHub point.
datahub_write (pointname, value [, force, quality, timestamp])
pointnameThe name of the point, as a string.
valueThe value to be assigned to the point—a number, string, or array.
forceCauses the write to occur even if the value and quality are the
same as the value currently in the DataHub instance. This is useful if
you are changing only the time stamp of the point. Enter t to force, or nil to not force.
qualityThe quality of a point, as a number. You can use the constants
OPC_QUALITY_* found in GetQualityName by requiring that file like this:
require("Quality.g");.
timestampThe time stamp in Windows time. Windows time is a floating point
number that can be obtained in the Gamma engine by requiring
Time.g like this:
require("Time.g");, then calling the
functions GetCurrentWindowsTime, UnixTimeToWindowsTime, or PointGetWindowsTime.
t on
success, otherwise an error message.
This function is the same as the Gamma force function, but the
pointname is a string, so the symbol never needs to
be created in the Gamma engine. This can be used to reduce Gamma engine load
when using a large number of points.