¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Time from an Analog


 

Hi All,
I'm sure this is obvious, but my brain is a bit soft lately...:)

I have an application where I have a 'countdown' analog signal representing time in seconds, where it is hours of time (1 hour = 3600d, 4 hours = 14400d).
I need to display the countdown time on touchpanels in a readable form, preferably hours and minutes.?
Anyone have a module or a simple technique to do this?


 

If this is a SmartGraphics panel?? Just format the analog as "time"


On Mon, Jun 21, 2021 at 9:25 PM ckangis <chris@...> wrote:
Hi All,
I'm sure this is obvious, but my brain is a bit soft lately...:)

I have an application where I have a 'countdown' analog signal representing time in seconds, where it is hours of time (1 hour = 3600d, 4 hours = 14400d).
I need to display the countdown time on touchpanels in a readable form, preferably hours and minutes.?
Anyone have a module or a simple technique to do this?


 

A simple calculation could help you :

Seconds = TotalTime % 60
Minutes = TotalTime? % 60
Hours = TotalTime? / 3600 % 3600

Regards,


Le?lun. 21 juin 2021 ¨¤?21:38, Phil Bridges <gravityhammer@...> a ¨¦crit?:
If this is a SmartGraphics panel?? Just format the analog as "time"

On Mon, Jun 21, 2021 at 9:25 PM ckangis <chris@...> wrote:
Hi All,
I'm sure this is obvious, but my brain is a bit soft lately...:)

I have an application where I have a 'countdown' analog signal representing time in seconds, where it is hours of time (1 hour = 3600d, 4 hours = 14400d).
I need to display the countdown time on touchpanels in a readable form, preferably hours and minutes.?
Anyone have a module or a simple technique to do this?


 

Sorry a little mistake

The calculation is the following :
Seconds = TotalTime % 60
Minutes = TotalTime / 60 % 60
Hours = TotalTime? / 3600 % 3600

Regards,

Le?mar. 22 juin 2021 ¨¤?06:42, S¨¦bastien LENOIR via <sebastien.lenoir=[email protected]> a ¨¦crit?:
A simple calculation could help you :

Seconds = TotalTime % 60
Minutes = TotalTime? % 60
Hours = TotalTime? / 3600 % 3600

Regards,


Le?lun. 21 juin 2021 ¨¤?21:38, Phil Bridges <gravityhammer@...> a ¨¦crit?:
If this is a SmartGraphics panel?? Just format the analog as "time"

On Mon, Jun 21, 2021 at 9:25 PM ckangis <chris@...> wrote:
Hi All,
I'm sure this is obvious, but my brain is a bit soft lately...:)

I have an application where I have a 'countdown' analog signal representing time in seconds, where it is hours of time (1 hour = 3600d, 4 hours = 14400d).
I need to display the countdown time on touchpanels in a readable form, preferably hours and minutes.?
Anyone have a module or a simple technique to do this?


 

Thanks Guys!

Phil, yes an SG panel and that was what I was looking/hoping for. Formats just as I wanted...? I'm using the (cm) CountDown Timer module.
When initially triggers, the analog populates as expected (xx:yy:zz), However, as the seconds count down (I see it decrementing in Debug) the display does not change. until I hit the STOP button on the CDTimer. At this point the display updates to the current time.

If I send values in DBg directly,? the display updates.
If I set up an Analog Increment with a 1d increment value, the Display counts as expected!!
I put the CDT Analog thru ABUFs and even though the values change in DBg, the display doesn't until the Timer is stopped.
?Its as if the Display object knows that the Analog decrement is coming from the CDT vs. my manual triggers - this of course doesn't make any sense!!

? ?Any ideas??? TIA!


 


 

Thanks, Daniel!? I'll check it out as I may have to use a different method.
This issue appears to be related to VTPro and TSW/xPanels....? Loading my project on an iPAD works fine, just not on TSW or xPanel...? Weird!!


 
Edited

As a follow up, The Analog/Time preset for TSW projects seems to be 'partially' broken - i.e. it does not update with incremental changes (but in a weird way...)

FTR, I've i'm using Daniel's updated module with the serial text for the remaining time...Thanks again Daniel!!