dpCopyConfigMerge()

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

Synopsis

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

Parameters

Parameter Meaning
sourceDpe Source data point element
destinationDpe Target data point 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 data point element will be copied into the target data point 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 data point 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 data point element into a target data point element. It is possible to define some exceptions with the help of the forceAttributes parameter.

The data point 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 data point element the source data point 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 data point element "ExampleDP_Arg1" to the data point 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

Data point function

Availability

UI, CTRL