Hi all ........
I have been asked by our client if it is possible to display the seconds on a counter (count down) when it is active (maybe convert the 32-bit signed integer to a float), is this possible, I have seen some examples of code to calculate this would this be the way to do it in a calc block for example?
Andre Dicaire
On 9 Aug 2021, at 19:10, Andre Dicaire <bounce-ADicaire@emersonexchange365.com> wrote:
<EE365_5F00_RGB_5F00_Standard_5F00_69x42-png_2D00_90x55-png> Update from Emerson Exchange 365 <4U2G7EF4S3IZ-jpg_2D00_70x70x2-jpg> Andre Dicaire as you know, time remaining is not an available parameter on these timer blocks. Time remaining is calculated by subtracting Elapsed_Time from Time_Duration. For display purposes, you can do this calculation in a picture variable in Operate, or with a Graphics expression in Live. Yes you can do this in the controller in a CALC block expression. But I would build a GEM or Dynamo that can be used to display Time Remaining. Simply point this display object to the module/TimerBlock and there is no need to modify the existing modules. The Time_duration parameter does not change so it places virtually no load on communications. View online You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here. Flag this post as spam/abuse.
as you know, time remaining is not an available parameter on these timer blocks. Time remaining is calculated by subtracting Elapsed_Time from Time_Duration. For display purposes, you can do this calculation in a picture variable in Operate, or with a Graphics expression in Live. Yes you can do this in the controller in a CALC block expression. But I would build a GEM or Dynamo that can be used to display Time Remaining. Simply point this display object to the module/TimerBlock and there is no need to modify the existing modules. The Time_duration parameter does not change so it places virtually no load on communications.
View online
You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here.
Flag this post as spam/abuse.
In reply to GaryL:
In reply to Andre Dicaire:
Using a Retentive Timer I can easily generate a count down with a floating point parameter (COUNT_DWN for example just in case you want to see more than integer) and then have in an ACT or CALC expression using the below which will format the number to the appropriate number of decimal places wanted:
DECIMAL1 := 1;POWER1 := EXPT(10, DECIMAL1);'^/COUNT_DWN.CV' := ROUND(('^/RET1/TIME_DURATION.CV' - '^/RET1/ELAPSED_TIMER.CV') * POWER1) / POWER1;
If you want to test on the fly you can add a DECIMALS parameter and then use that parameter to set the internal DECIMAL1 variable to see the effects. I can't attach a picture for some reason but it does work.
The same can be used for a Counter but the decimal places won't be required because the values would always be integers but this same logic would work.