Page 1 of 1
Is there a way to create a custom config?
Posted: Mon Jul 14, 2025 6:26 pm
by eladsa
HI,
Is there a way to create a custom config, such as the "Default value" config? Instead of setting a default value in the online value, I'd like to make a function (via code) that takes the original value and sets the online value accordingly.
I appreciate any help you can provide.
Elad
Re: Is there a way to create a custom config?
Posted: Thu Jul 17, 2025 2:49 pm
by hpuchegger
DId you already try our WinCC OA AI Assistant? It gives me following information:
In WinCC OA, you can create custom configurations similar to the "Default value" configuration by implementing a function in your code that sets the online value based on the original value. This can be achieved using the Control language (CTRL) or through the WinCC OA API.
To set the online value programmatically, you can define a custom function that retrieves the original value and applies your logic to set the online value accordingly. This can be done using the setValue() function or similar methods available in the API.
For example, you might create a CTRL script that looks something like this:
Code: Select all
main() {
// Retrieve the original value
originalValue = getValue("YourDataPointName:_original.._value");
// Apply your custom logic
onlineValue = originalValue * 2; // Example logic
// Set the online value
setValue("YourDataPointName:_online.._value", onlineValue);
}
This script would need to be executed in the appropriate context, such as a control loop or triggered by an event.
Maybe you can try if this works for you.
Br, Herbert
Re: Is there a way to create a custom config?
Posted: Thu Jul 17, 2025 3:03 pm
by gschijndel
If you do not mind adding an extra datapoint element, then you should look at the
DP function.
Re: Is there a way to create a custom config?
Posted: Thu Jul 17, 2025 3:33 pm
by leoknipp
If you want to set a value for a DP element you can only set the _original.._value.
The _online.._value is in the domain of the Event Manager as an read only config and cannot be modified by an external source.
Why do you want to modify the "_online.._value"?
Best Regards
Leopold Knipp
Senior Support Specialist
Re: Is there a way to create a custom config?
Posted: Sun Jul 20, 2025 8:28 am
by eladsa
Herbert, unfortunately, the AI assistant sometimes invents things

You can't do a dpSet on the online value.
gschijndel, I'm trying to avoid the extra DP element.
Leopold, I want to set the online value since I'm getting a value as the original, and I want to change it using some logic. For example, a mapping function, where I receive 2, and I want to set it as 3, I get 4 and I want to set it as 2, etc.
Re: Is there a way to create a custom config?
Posted: Wed Aug 06, 2025 1:54 pm
by adaneau
Hey,
Are those values coming through a driver? If yes maybe you could use msg conversion?
BR
Alex
Re: Is there a way to create a custom config?
Posted: Thu Aug 07, 2025 9:35 am
by eladsa
Thank you, Alex.
Some of them are coming via a driver, and the msg config is an option for those. However, with a msg config I lose the option to see the source\raw value, which I want to be able to.
And, this does not work for non-driver values.
Elad
Re: Is there a way to create a custom config?
Posted: Thu Aug 07, 2025 9:44 am
by gschijndel
As a last resort it is possible to use the
_general config
Re: Is there a way to create a custom config?
Posted: Thu Aug 07, 2025 11:52 am
by eladsa
gschijndel, I will have to check. There are other limitations for this config.
Thanks!
Re: Is there a way to create a custom config?
Posted: Tue Aug 12, 2025 8:40 am
by leoknipp
The _general config will be no option in this case from my point of view.
Using the _general config will have the following disadvantages:
-- No archiving of _general config attributes
-- No possibility to do an alarming for the values written to the _general config
Best Regards
Leopold Knipp
Senior Support Specialist