Good day ,
Is there a method (script) to add a config (DP_FUNCTION) to an already exist data points at runtime as example using a push button .
As well I have another question , is there a way to add a config to a data point instance not to be applied to the master data point , such as this config to be applied only to a single data point from multiple instance master template
thanks
adding config at runtime
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: adding config at runtime
A config can be added by using a dpSet() and the config + _type attribute.
Which values are possible for the _type attribute is described in the WinCC OA documentation: Reference tables --> Data point configs.
Depending on the config you want to add you have to set then several of the attributes. Sometimes it is necessary to use a detail number (_config.detail number._attribute) to be able to set all attributes.
Best Regards
Leopold Knipp
Senior Support Specialist
Which values are possible for the _type attribute is described in the WinCC OA documentation: Reference tables --> Data point configs.
Depending on the config you want to add you have to set then several of the attributes. Sometimes it is necessary to use a detail number (_config.detail number._attribute) to be able to set all attributes.
Best Regards
Leopold Knipp
Senior Support Specialist
- IBRAHIMALALI
- Posts:67
- Joined: Thu Oct 05, 2017 5:28 pm
Re: adding config at runtime
Thank you it works now .
what about adding config to one instance of the data point not to master datapoint .
what about adding config to one instance of the data point not to master datapoint .
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: adding config at runtime
If you want to add a config to master datapoint you have to do more steps, e.g. setting the datapoint elements for the "dynamic datapoint" (_dt_) which belongs to the dp-type.
Otherwise the config is not detected as "power config" and will not be copied to the instances.
For a datapoint type where a master datapoint is configured you should never add configs to the instances by script.
In case of master datapoints/power configs the information on the master datapoint and the instances must be consistent.
It is getting more difficult when using type references, then the power configs must be added on the referenced dp type and not at the datapoint type where the reference is used.
If you want to get more detailed information please get in contact with your common WinCC OA support.
Best Regards
Leopold Knipp
Senior Support Specialist
Otherwise the config is not detected as "power config" and will not be copied to the instances.
For a datapoint type where a master datapoint is configured you should never add configs to the instances by script.
In case of master datapoints/power configs the information on the master datapoint and the instances must be consistent.
It is getting more difficult when using type references, then the power configs must be added on the referenced dp type and not at the datapoint type where the reference is used.
If you want to get more detailed information please get in contact with your common WinCC OA support.
Best Regards
Leopold Knipp
Senior Support Specialist
- fmulder
- Posts:330
- Joined: Wed Feb 03, 2010 9:46 am
Re: adding config at runtime
I believe the master datapoint concept works as follows:
1) You configure a config on the master
2) The first time, all attributes of the config are copied to all instances
3) The next time, certain attributes of the config are copied to the instances (so that you have some freedom in your instances)
This means that you may only change the attributes, in the configs of your instances, that are not overwritten by the master. That is : you can change (via scripting) the attributes that you see when you change the powerconfig in the para.
Also, the concept will only copy from master to instance. So, Yes, you can add a config to an instance as long as the master doesn't have such a config.
Example: you could add a _dp_fct config to an instance as long as you do not add such a config to the master.
(When the master has no _dp_fct config, then it wont erase or change the _dp_fct config on the instance)
p.s.
if you plan to create configs by scripting, then might consider to drop the entire master datapoint concept. We normally generate datapoint type, instance, configs via scripting (based on a database or definition in XML)
share the fun
Frenk Mulder
1) You configure a config on the master
2) The first time, all attributes of the config are copied to all instances
3) The next time, certain attributes of the config are copied to the instances (so that you have some freedom in your instances)
This means that you may only change the attributes, in the configs of your instances, that are not overwritten by the master. That is : you can change (via scripting) the attributes that you see when you change the powerconfig in the para.
Also, the concept will only copy from master to instance. So, Yes, you can add a config to an instance as long as the master doesn't have such a config.
Example: you could add a _dp_fct config to an instance as long as you do not add such a config to the master.
(When the master has no _dp_fct config, then it wont erase or change the _dp_fct config on the instance)
p.s.
if you plan to create configs by scripting, then might consider to drop the entire master datapoint concept. We normally generate datapoint type, instance, configs via scripting (based on a database or definition in XML)
share the fun
Frenk Mulder
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: adding config at runtime
As described in my previous post you should not add configs to elements for a datapoint where a master datapoint is exisiting.
Even if the manually added config can be configured in the Para module the data model is becoming inconsistent.
When using power configs and normal configs at the same element it will be confusing for the user why some configs can be modified only using the "PowerConfig configuration" and other ones can be edited using the configuration panel.
Best Regards
Leopold Knipp
Senior Support Specialist
Even if the manually added config can be configured in the Para module the data model is becoming inconsistent.
When using power configs and normal configs at the same element it will be confusing for the user why some configs can be modified only using the "PowerConfig configuration" and other ones can be edited using the configuration panel.
Best Regards
Leopold Knipp
Senior Support Specialist