How can a datapoint be configured to prevent online value being updated by doing an old/new comparison.
by inserting a smoothing config to a datapoint i expected the online value to stay unchanged when the same value is written to the original value. but when i use dpset to from a control manager to write the same value to the datapoint the online value updates.
I know I could do a dpget before a dpset to avoid writing the same value to the datapoint, but i was hoping i would be able to do this with a power config
Please help
Thank you
Smoothing dpset values
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: Smoothing dpset values
During runtime the _smooth config is only used by the driver when receiving values from the PLC and sending them to the Event Manager. The Event Manager does not have any information if a _smooth config exists or not.
Therefore the _smooth config does not work when a value is written using a CTRL script.
Best Regards
Leopold Knipp
Senior Support Specialist
Therefore the _smooth config does not work when a value is written using a CTRL script.
Best Regards
Leopold Knipp
Senior Support Specialist
- yasas@applied.co.uk
- Posts:21
- Joined: Wed Sep 21, 2016 12:26 pm
Re: Smoothing dpset values
Thank you for your answer!
Is there any other way to do an old/new comparison without explicitly checking the current value with dpGet?
Thank you
Is there any other way to do an old/new comparison without explicitly checking the current value with dpGet?
Thank you
- nmnogueira
- Posts:125
- Joined: Thu May 05, 2011 12:59 pm
Re: Smoothing dpset values
It depends on what you are implementing.
If you are writing a script to do that, you should:
- Create a variable in a script to save the old value
- Create a dpConnect or dpQueryConnect to connect to the DPE and update the script variable with the current value of the DPE.
- When you want to change the value, compare with the old one (internal variable), and use dpSet() only if changed.
This is, as far as I know, the best implementation performance-wise.
If it's not very resource intensive (like a user button click), you can just make a dpGet() followed by a dpSet().
If you are writing a script to do that, you should:
- Create a variable in a script to save the old value
- Create a dpConnect or dpQueryConnect to connect to the DPE and update the script variable with the current value of the DPE.
- When you want to change the value, compare with the old one (internal variable), and use dpSet() only if changed.
This is, as far as I know, the best implementation performance-wise.
If it's not very resource intensive (like a user button click), you can just make a dpGet() followed by a dpSet().
- yasas@applied.co.uk
- Posts:21
- Joined: Wed Sep 21, 2016 12:26 pm
Re: Smoothing dpset values
I am writing a script, which is a bit resource intensive. I'll go with the dp connect approach
Thank you for your help
Thank you for your help