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,763
Hello, I want to connect the Factorytalkview ME with rslogix500 to see the live response of HMI buttons in Rslogix500 ladder code . I am using PLC...
Replies
4
Views
27
Hello everyone I have the next issue with FactoryTalk Linx, when i configure the Ethernet driver and try to find the IP Address of the PLC Device...
Replies
0
Views
60
We are having issues with our viewpoint server randomly crashing and only loading the error page if anything at all. It lives on 3 servers all of...
Replies
0
Views
60
Hello, I have a panelview plus that reads from 4 different PLC's. 2 of these used to be Micrologix PLC's and someone else went and updated them to...
Replies
3
Views
125
Back
Top Bottom