cforce

cforce — creates a point and forces a value to be written to it.

Syntax

(cforce name value [confidence])
    

Arguments

name

The name of the point. This is a string.

value

A string representation of the value for the point. It will be interpreted into the type specified by the type parameter.

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.

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 is the same as cset, except that it forces a write even if the DataHub would otherwise refuse it, for example if the point is old, the value is insignificant or hasn't changed, or the point is marked as read-only. 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 set and force.