Hi,
if I would want to get the time stamp of the last value change of a datapoint, how would I do that in a CTRL script? I already checked the help document but I found nothing on that topic.
I want to evaluate if the value change is not older than 5 seconds for example.
Thanks
Regards
Michael Danzer
Get timestamp of data point value (CTRL)
- michael.danzer
- Posts:13
- Joined: Thu Aug 03, 2017 11:13 am
Get timestamp of data point value (CTRL)
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: Get timestamp of data point value (CTRL)
The timestamp is saved in the attribute _stime for the configs _original, _online and _offline.
When reading current values normally the conifg _online is used.
Doing a loop, e.g. using dpGet(), to check the last update time is not the best approach. Normally a connect function (e.g. dpConnect()) is used to get the current values.
Best Regards
Leopold Knipp
Senior Support Specialist
When reading current values normally the conifg _online is used.
Doing a loop, e.g. using dpGet(), to check the last update time is not the best approach. Normally a connect function (e.g. dpConnect()) is used to get the current values.
Best Regards
Leopold Knipp
Senior Support Specialist
- Gertjan van Schijndel
- Posts:634
- Joined: Mon Aug 02, 2010 10:37 am
Re: Get timestamp of data point value (CTRL)
Perhaps the function 'dpGetMaxAge' is of interest to you.
It will instruct the driver to get a new value if the value is older than the specified maximum age.
So if possible it will always return a value that is not too old.
It will instruct the driver to get a new value if the value is older than the specified maximum age.
So if possible it will always return a value that is not too old.