dpCopyConfigMerge()

dpCopyConfigMerge() copies specific configs from a source datapoint element into a target datapoint element.

Synopsis

void dpCopyConfigMerge(string sourceDpe, string destinationDpe, dyn_string copyConfigs = makeDynString(), int &error, mapping forceAttributes = emptyMapping);

Parameters

Parameter Meaning
sourceDpe Source datapoint element
destinationDpe Target datapoint element
copyConfigs

Defines a list of configs that shall be copied. If no configs are specified here (empty dyn_string), all configs from the source datapoint element will be copied into the target datapoint element. Otherwise only these that have been specified in this parameter.

If a config was specified that cannot be copied (e.g. _offline or _original), an error message is returned in the WinCC OA log viewer and this config will be ignored.

error Return value of the error code. See below.
forceAttributes Mapping (key<->value) of attributes which should not be copied from the source to the target datapoint element. Thereby the key is the attribute name and the value the attribute value. The specification of the name has the following schema: <config>.<[detail]>.<attribute> (e.g. _alert_hdl.._active). By default this parameter contains an empty mapping, i.e. all attributes will be copied.

Return Value

None

Errors

See function dpCopy() for the possible error codes.

Description

dpCopyConfigMerge() copies specific configs from a source datapoint element into a target datapoint element. It is possible to define some exceptions with the help of the forceAttributes parameter.

The datapoint elements must be of the same type.

Before the copy process the dpCopyConfigMergeBufferClear() function must be called to clear the buffer.

The same applies if between two copy processes of the same source datapoint element the source datapoint element changes. In this case the buffer has also to be cleared using the dpCopyConfigMergeBufferClear() function. Otherwise the old information would be copied.

Exampl e

Copies the configs of the datapoint element "ExampleDP_Arg1" to the datapoint element "ExampleDP_Arg2".

main()
{
  dyn_string copyConfigs;
  mapping forceAttributes;
  int error;
  copyConfigs = makeDynString("_alert_class", "_alert_hdl");
  dpCopyConfigMergeBufferClear();
  dpCopyConfigMerge("ExampleDP_Arg1.","ExampleDP_Arg2.",
  copyConfigs, error, forceAttributes);
}

Assignment

Datapoint function

Availability

UI, CTRL