set

set — sets the value of a point.

Syntax

(set name value [confidence])
    

Arguments

name

The name of the point. This is a string.

value

A string representation of the value for the point. The point value will be interpreted as integer, float or string based on the contents of the value string. This function tries each type in order, and uses the first type for which the value parameter is a valid representation. Double quotes around the value parameter are ignored. For example:

    123 is an integer.

    123.4 is a float.

    1.234e2 is a float.

    "123" is an integer.

    123abc is a string.

confidence

A confidence factor in the range of 0 to 100 (optional). This is not used by the DataHub, so is available to programs that produce graduated confidence, such as expert systems. If this value is not specified, it is set to 100.

All strings can be surrounded by double-quotes if the string contains spaces or special characters. The backslash character (\) escapes double quotes and backslashes within the string. Newline, carriage return, form feed and tab are represented with \n, \r, \f, \t respectively. Strings must not contain newline characters.

Returns

A message indicating success or error. Please refer to Return Syntax for details.

Description

This command sets the value of a point. When this value is set, the following attributes of the point are set as follows:

    seconds and nanoseconds are set to the current time on the machine running the DataHub.

    locked, sec, and quality are all maintained at their previous values for this point.

    flags is set to 0.

Please refer to the write command for more information about these parameters. See also cset, force, and cforce.