Support Forums
Report Tag - Duration Parameter Variable Problems

Hi folks, having problems with the reporting tag, and the time duration for this. I would like the duration to match a calculation tag. I am using the tag as a reference in the parameter for the Report Duration as shown in the screenshot below.

However, it does not act as I would expect… and I have had to create multiple report tags to get around it in the short term… however this is messy and not desirable.

Problem 1: The report tag “calculates” its own “Report End Time” even when I try to set this to 0 or 1. I have not created a parameter. I have tried to input 0 or 1 however it then deletes the parameter in the Report Duration…

Problem 2: A error sometimes pops up saying value must be between 1-32767, despite the reference tag being within this range. This seems to be sporadic and depends upon the order in which I input information in the “period” tab…

The referenced tag “ReportTime” is calculated to give a value rounded up to the nearest 100, always between the values of 1-32767:

ReportTime = Max( 1 , Min((Int([Tag1]/100)*100),32700) )

“Tag1“ is a counter that is linked to the \secondflasher so that it increments approx every second when active. Max expected time is likely 5 hours.
636c3a996998e

Hi folks, having problems with the reporting tag, and the time duration for this. I would like the duration to match a calculation tag. I am using the tag as a reference in the parameter for the Report Duration as shown in the screenshot below. However, it does not act as I would expect… and I have had to create multiple report tags to get around it in the short term… however this is messy and not desirable. Problem 1: The report tag “calculates” its own “Report End Time” even when I try to set this to 0 or 1. I have not created a parameter. I have tried to input 0 or 1 however it then deletes the parameter in the Report Duration… Problem 2: A error sometimes pops up saying value must be between 1-32767, despite the reference tag being within this range. This seems to be sporadic and depends upon the order in which I input information in the “period” tab… The referenced tag “ReportTime” is calculated to give a value rounded up to the nearest 100, always between the values of 1-32767: ```` ReportTime = Max( 1 , Min((Int([Tag1]/100)*100),32700) ) ```` “Tag1“ is a counter that is linked to the \secondflasher so that it increments approx every second when active. Max expected time is likely 5 hours. ![636c3a996998e](serve/attachment&path=636c3a996998e)

Fair point. I tried this and see some unexpected behaviour in how the tag calculates the report end time when an expression is used for the duration. I'm going to write this up to have the development folks have a look at it.

Your error may occur if your tag ever gets an invalid value. I'd suggest wrapping [Tag1] in a PickValid() with a default value if the tag is invalid.

As for your calculation, you may want to use Limit () rather than Max () and Min (). Also, you may wish to update your calculation to only update if the trigger condition is true, then delay your report trigger to give the calculation time to execute. That will prevent the refresh method on the tag from running each time the counter increments.

Fair point. I tried this and see some unexpected behaviour in how the tag calculates the report end time when an expression is used for the duration. I'm going to write this up to have the development folks have a look at it. Your error may occur if your tag ever gets an invalid value. I'd suggest wrapping [Tag1] in a PickValid() with a default value if the tag is invalid. As for your calculation, you may want to use Limit () rather than Max () and Min (). Also, you may wish to update your calculation to only update if the trigger condition is true, then delay your report trigger to give the calculation time to execute. That will prevent the refresh method on the tag from running each time the counter increments.

Trihedral Engineering Ltd.

Thanks for reaching out to us regarding this. The issue has been corrected and will work as expected in a soon to be released version of VTScada.

Thanks for reaching out to us regarding this. The issue has been corrected and will work as expected in a soon to be released version of VTScada.

Trihedral Engineering Ltd.

Here is the current workaround for this:

Workaround:
Remove the parameter expressions on Report Duration and Report End Time if any
Set the Report Duration to a plain value that is guaranteed longer than or equal to what the expression would be (for example, if the desired duration won't be longer than 5 hours, set it to 5 hours or longer), click on Apply
Right click on Report Duration, click on Add Parameter Expression
Enter the desired duration expression in seconds (what's selected in the dropdown list before the operation is irrelevant in this case), for example 5 60 60, which is 5 hours
Ignore the possible wrong value in the Report End Time field, click on OK and then Apply (you need to apply before the follow steps)
Right click on Report End Time, click on Add Parameter Expression
Enter an expression in this format: Concat("R", DURATION + ENDTIME), where DURATION is the expression entered above and ENDTIME is the desired Report End Time in seconds
Click on OK and then Apply, then close the tag properties window and reopen it
The values in Report Duration and Report End Time should now be the desired values

Here is the current workaround for this: Workaround: Remove the parameter expressions on Report Duration and Report End Time if any Set the Report Duration to a plain value that is guaranteed longer than or equal to what the expression would be (for example, if the desired duration won't be longer than 5 hours, set it to 5 hours or longer), click on Apply Right click on Report Duration, click on Add Parameter Expression Enter the desired duration expression in seconds (what's selected in the dropdown list before the operation is irrelevant in this case), for example 5 * 60 * 60, which is 5 hours Ignore the possible wrong value in the Report End Time field, click on OK and then Apply (you need to apply before the follow steps) Right click on Report End Time, click on Add Parameter Expression Enter an expression in this format: Concat("R", DURATION + ENDTIME), where DURATION is the expression entered above and ENDTIME is the desired Report End Time in seconds Click on OK and then Apply, then close the tag properties window and reopen it The values in Report Duration and Report End Time should now be the desired values

Trihedral Engineering Ltd.

Thanks Dave, seems to work. Do I need to be carefull of this workaround when updating future versions?

Thanks Dave, seems to work. Do I need to be carefull of this workaround when updating future versions?

The short answer is yes, be mindful that this may need to be updated when installing a future update. That said, hopefully you can just note that and do a quick check when doing upgrades.

The short answer is yes, be mindful that this may need to be updated when installing a future update. That said, hopefully you can just note that and do a quick check when doing upgrades.

Trihedral Engineering Ltd.

182
6
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft