dpSetDescription()

Sets a comment for the data point element dp.

The function replaces dpSetComment(), which remains for compatibility!

Synopsis

int dpSetDescription (string dp, langString comment);

Parameters

Parameter Meaning
dp data point element to be commented on
comment comment

Return Value

If successful 0, otherwise -1.

Errors

Errors can be retrieved with getLastError(). An error message is issued in the event of incorrect DPs or missing arguments!

Description

The function dpSetDescription() sets a comment for the data point element dp. This comment can be retrieved with the help of the function dpGetDescription(). Comments are not archived historically. Comments which have been replaced can therefore no longer be retrieved!

The function replaces dpSetComment(), which is conserved for compatibility.

The use of "@" or another character used as DPCommentSeparator, will result in the data point comment being separated at the character. The characters after the first "@" character will be saved as data point format, the characters after the second "@" as the data point unit. Should the "@"character be needed, the separator character can be changed with the config entry [general] DPCommentSeperator.

Example

A new data point is created, a comment is written and then read out again for checking.

main()
{
   dpCreate("number_1","ExampleDP_Int");
// new DP
   dpSetDescription("number_1.","Here is the comment");
   DebugN(dpGetDescription("number_1."));
//output in the log viewer
}

Assignment

Data point function, waiting Control function

Availability

CTRL