Firstly, for the seconds to h:m:s I would use the code from the Doc 1701, Pac Control Command Reference.
Page 573. Get Seconds Since Midnight. (If you are in Pac Control, click on Help, Manuals, Command Reference).
To find elapsed time in HOURS, MINUTES, SECONDS since midnight using standard commands:
Move the seconds to an integer 32 variable: TEMP_VAR
Divide TEMP_VAR by: 3600 and move to: HOURS
MODULO TEMP_VAR by: 3600 and move to: TEMP_VAR
Divide TEMP_VAR by: 60 and move to: MINUTES
MODULO TEMP_VAR by: 60 and move to: SECONDS.
To find the same thing using OptoScript code:
TEMP_VAR = GetSecondsSinceMidnight();
HOURS = TEMP_VAR / 3600;
MINUTES = (TEMP_VAR % 3600 / 60;
SECONDS = (TEMP_VAR % 3600) % 60;
In your case, just put;
Temp_Var = Int_Stop_time_in_Seconds;
Secondly, have you thought about using the command ‘Get Off-Time Totalizer’?
(Perhaps you do not have a digital point you are using to turn off the conveyor?)
Third (Ok, its an after thought), but the converting to a string to display… Why? You can display Ints just fine, so just put the H M S on the display as three variables… Done?