S
OK... I want to take a "TotalSeconds" value (Integer) and convert it to HH:MM:SS format for display on a Panelview 600.
The 'formula' I use that appears to work great on paper is:
FloatHour = TotalSeconds/3600
DecimalHour = FLOOR(FloatHour) ('This is the HOUR to Display...)
FloatMinutes = (DecimalHour - FloatHour) x 60
DecimalMinutes = FLOOR(FloatMinutes) ('This is the MINUTES to Display...)
DecimalSeconds = (DecimalMinutes - FloatMinutes) x 60 ('This is the SECONDS to Display...)
so...On the Panelview, I have it set to display
DecimalHourecimalMinutesecimalSeconds
My problem is... the PLC rounds up. When I try to separate the integer from the fraction, it ain't happening.
An example:
TotalSeconds = 27381
FloatHour = 27381 / 3600 = 7.605
DecimalHour = *floor(7.605) - 7.605
(I cannot perform this function, because a SLC-500 does not have a floor function that I am aware of...)
Anyway, to continue:
.605 x 60 = 36.3
.3 x 60 = 18
So I would --love-- to display "07:36:18"...
I currently have no idea how to separate the integer.
Any Gurus got an idea?
The 'formula' I use that appears to work great on paper is:
FloatHour = TotalSeconds/3600
DecimalHour = FLOOR(FloatHour) ('This is the HOUR to Display...)
FloatMinutes = (DecimalHour - FloatHour) x 60
DecimalMinutes = FLOOR(FloatMinutes) ('This is the MINUTES to Display...)
DecimalSeconds = (DecimalMinutes - FloatMinutes) x 60 ('This is the SECONDS to Display...)
so...On the Panelview, I have it set to display
DecimalHourecimalMinutesecimalSeconds
My problem is... the PLC rounds up. When I try to separate the integer from the fraction, it ain't happening.
An example:
TotalSeconds = 27381
FloatHour = 27381 / 3600 = 7.605
DecimalHour = *floor(7.605) - 7.605
(I cannot perform this function, because a SLC-500 does not have a floor function that I am aware of...)
Anyway, to continue:
.605 x 60 = 36.3
.3 x 60 = 18
So I would --love-- to display "07:36:18"...
I currently have no idea how to separate the integer.
Any Gurus got an idea?