EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-03-16 10:02 AM . Last Modified: 2023-05-02 11:46 PM
Hi everyone,
I am trying to develop a sort of timelapse mimic where the value shown is not the current value but the "end last" value of a time interval in the past. I accomplished this partially by using the historic function "end last" in the "value" property of the text.
analog_point.Historic.ProcessedValue('M-25H','M-24H','End Last')
The example was made with a fixed interval in the past (24h before), but I would like to have this interval to be modified by the user through a variable in the same mimic. Is there a syntax to include a variable like this in the formula above? or there is another method to obtain the same result?
Thank you,
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-04-05 02:28 AM
To build a tag using an expression (calling the REGISTRY function) you need to use indirect tags, see Indirect Tags, and do string concatenation. Something like:
['analog_point.Historic.ProcessedValue(' + REGISTRY('''Start''', '''M-25H''') + ',' + REGISTRY('''End''', '''M-24H''') + ',''End Last'')']
To change the tag in an animation from a script you need to remember to include the double quotes that enclose the tag in the new value.
NB. Using an OPC HDA tag is preferable to calling the CHistoryBase::ProcessedValue() method:
"analog_point;End Last;M-25H;1H"
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-03-20 09:41 PM . Last Modified: 2023-03-20 09:41 PM
It has been done in the past using the REGISTRY() function, basically store the two ranges as strings, i.e.
analog_point.Historic.ProcessedValue('REGISTRY('Start', 'M-25H')','REGISTRY('End', 'M-24H')','End Last')
Then you need to update new values to REGISTRY() for the time span to change. Things to consider:
1. Make sure you server can handle the extra load, current value is quick to real as memory resident, historic is disk resident with a memory cache
2. Start and End are just example strings, use whatever you like but just note that the REGISTRY() is client side shared amongst all mimics on your screen, so if you're good with all mimics on display having the same setting it should work, else you need to add something to make the setting used on each mimic unique
3. The defaults only work when the setting doesn't exist, so you'll need a Mimic_OnLoad script to set them to something sensible for each mimic load
4. You'll then also need some script that move the timestamps forward and back by updating the REGISTRY setting
5. I may have got the quotes wrong in the REGSITRY function, can't test atm, may be double-quotes not single
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-04-04 12:57 PM
Thank you Adam for your response. The REGISTRY function on the ProcessedValue argument doesn´t seem to work. I tried simple quotes and double quotes without success.
I also tried running scripts to change the "value" animation but the result was it was interpreted as a string, giving me a "analog_point.Historic.ProcessedValue('M-25H','M-24H','End Last')" on the mimic instead of the result of the value.
There is other possible method?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-04-05 02:28 AM
To build a tag using an expression (calling the REGISTRY function) you need to use indirect tags, see Indirect Tags, and do string concatenation. Something like:
['analog_point.Historic.ProcessedValue(' + REGISTRY('''Start''', '''M-25H''') + ',' + REGISTRY('''End''', '''M-24H''') + ',''End Last'')']
To change the tag in an animation from a script you need to remember to include the double quotes that enclose the tag in the new value.
NB. Using an OPC HDA tag is preferable to calling the CHistoryBase::ProcessedValue() method:
"analog_point;End Last;M-25H;1H"
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-04-05 02:58 AM . Last Modified: 2023-04-05 03:22 AM
You got there before me Andrew!
p.s.
When including a single quote in a string enclosed by single quotes, use two of them. It's two single quotes not one double quote!
'in my string I have a single quote here which I type as two single quotes->'' end of my string'
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-04-17 12:13 PM
Thank you Andrew,
It worked using the indirect tag and the OPC HDA tag:
['analog_point;End Last;' + REGISTRY('Start','M-25H') + ';1H']
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.