FactoryTalk - Seconds to MM:SS

ShacharY

Member
Join Date
Jan 2015
Location
CA
Posts
16
Hey,
I'm trying to convert seconds to MM:SS view.
using tag: PLC\IN_CCD_TIME (integer) from PLC timer.
Numeric tag (HMI) MM: PLC\IN_CCD_TIME % 3600 / 60 SS: PLC\IN_CCD_TIME % 60
when seconds reach 59 then switch to 00, the minutes not added 1 only when seconds pass the 30. i know that's all about floating point.
Must to use seconds on PLC and use it for HMI as MM:SS.

need any help to use seconds as MM:SS,
Thanks!
 
Hey rdrast,
I know about the 3600 that isn't relevant.
The problem is about counting the MM. for example:
(PLC) T4-XX (sec) & (HMI) Elapsed Time - MM:SS
T4-20 Elapsed Time-00:20
T4-29 Elapsed Time-00:29
T4-31 Elapsed Time-01:31
T4-59 Elapsed Time-01:59
T4-60 Elapsed Time-01:00
T4-61 Elapsed Time-01:01
T4-89 Elapsed Time-01:29
T4-90 Elapsed Time-02:30
T4-91 Elapsed Time-02:31

The T4 (INT) at any time passing the 0.5% after HMI division, the MM add 1. and after passing the 59 sec the MM not added 1.

Thanks.
 
I'm using INT.
As you said, the table is completely wrong but this is how i see the calculation of the MM in the HMI. :cry:
 
Suspecting some rounding with the /-function.
Where 0.5 is considered 1.


EDIT:

((PLC\IN_CCD_TIME % 3600) - ((PLC\IN_CCD_TIME % 3600) %60)) / 60

That will prevent any rounding issues. In theory; I think. Not tested. Not sure it's a valid expression.


But why do this in the HMI, not in the PLC? (just wondering)
 
Last edited:
Suspecting some rounding with the /-function.
Where 0.5 is considered 1.


EDIT:

((PLC\IN_CCD_TIME % 3600) - ((PLC\IN_CCD_TIME % 3600) %60)) / 60

That will prevent any rounding issues. In theory; I think. Not tested. Not sure it's a valid expression.


But why do this in the HMI, not in the PLC? (just wondering)


Super! that's work perfect!
Many thanks!
 
Last edited:
Another way...

See also...

7771 - Displaying a Timer Accumulator value in Hour:Minute:Second format
Access Level: TechConnect

In short...

Create two numeric displays and use these expressions...

For minutes: ( ({[ControlLogix]Timer.acc}%3600000)/ 1000)/60

For seconds: ({[ControlLogix]Timer.acc}%60000)/ 1000

Regards,
George
 

Similar Topics

I have a numeric display which currently displays a value (Specified by Connections>Value field) However I want it to add an "s" or "sec" after...
Replies
8
Views
5,688
Hello, I was looking to store some values from our FactoryTalk Application using Datalog to a MariaDB. I see there is quite a bit of documentation...
Replies
0
Views
1
Hi Folks, who know why after start FactoryTalk activation manager V4.03, click "Get New Activations", it displays Is not I appreciate with any...
Replies
0
Views
41
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
2
Views
73
I need to use a TreeView in my FactoryTalk SE project and i found it under "ActiveX Object" > "Microsoft TreeView Control 6.0 (SP4)". Everything...
Replies
0
Views
24
Back
Top Bottom