hexagon logo

output program runtime

I've searched for this as I know this has been discussed once or twice. Can you output the runtime of a program? Or track it somehow just bu executing a program?

We are running CMMs (machinists, QA techs) virtually around the clock and boss want to know if we can track this for a week or so to justify getting a person to just run parts for the machinists.
Parents
  • I have been recoding runtimes, in a seperate text file, for years. The code I use to do it is below. It was written for readability but could be modified to be more easily imported into another program.

    $$ NO,'$
    $$ NO,' start cntr segment one
    ASSIGN/DTE = SYSTEMDATE("M'/'d'/'y'")
    ASSIGN/TM2 = SYSTEMTIME("HH':'mm':'ss")
    FPTR =FILE/OPEN,C:\USAGE\FPTR.TXT,APPEND
    FILE/WRITELINE,FPTR," "
    FILE/WRITE_BLOCK,FPTR,DTE
    FILE/WRITELINE,FPTR," YOUR PART NUMBER "
    FILE/CLOSE,FPTR,KEEP
    ASSIGN/S2 = RIGHT(TM2,2)
    ASSIGN/M2 = MID(TM2,3,2)
    ASSIGN/H2 = LEFT(TM2,2)
    ASSIGN/H2S_B = (H2)*3600
    ASSIGN/M2S_B = (M2)*60
    ASSIGN/TO_SC_2 = (H2S_B)+(M2S_B)+(S2)
    $$ NO,' end cntr segment one
    $$ NO,'
    $$ NO,'
    $$ NO,'
    $$ NO,' start cntr segment two
    ASSIGN/TM1 = SYSTEMTIME("HH':'mm':'ss")
    ASSIGN/S1 = RIGHT(TM1,2)
    ASSIGN/M1 = MID(TM1,3,2)
    ASSIGN/H1 = LEFT(TM1,2)
    ASSIGN/H2S_A = (H1)*3600
    ASSIGN/M2S_A = (M1)*60
    ASSIGN/TO_SC_1 = (H2S_A)+(M2S_A)+(S1)
    ASSIGN/EL_SEC = (TO_SC_1)-(TO_SC_2)
    ASSIGN/EL_MIN = (EL_SEC)/60
    FPTR =FILE/OPEN,C:\USAGE\FPTR.TXT,APPEND
    FILE/WRITE_BLOCK,FPTR,"START TIME "
    FILE/WRITE_BLOCK,FPTR,TM2
    FILE/WRITE_BLOCK,FPTR," MINUTES MEASURING "
    FILE/WRITE_BLOCK,FPTR,EL_MIN
    FILE/WRITELINE,FPTR," "
    FILE/ CLOSE
    $$ NO,' end cntr segment two
    $$ NO,'
    $$ NO,'


    Just an FYI on this code.

    IT WORKS GREAT!

    I've got in running on the 4 CMMs and have had no problems with. I did add the FILE/CLOSE at the end of it since we have various machines running to it.

    Thank you Mark.
Reply
  • I have been recoding runtimes, in a seperate text file, for years. The code I use to do it is below. It was written for readability but could be modified to be more easily imported into another program.

    $$ NO,'$
    $$ NO,' start cntr segment one
    ASSIGN/DTE = SYSTEMDATE("M'/'d'/'y'")
    ASSIGN/TM2 = SYSTEMTIME("HH':'mm':'ss")
    FPTR =FILE/OPEN,C:\USAGE\FPTR.TXT,APPEND
    FILE/WRITELINE,FPTR," "
    FILE/WRITE_BLOCK,FPTR,DTE
    FILE/WRITELINE,FPTR," YOUR PART NUMBER "
    FILE/CLOSE,FPTR,KEEP
    ASSIGN/S2 = RIGHT(TM2,2)
    ASSIGN/M2 = MID(TM2,3,2)
    ASSIGN/H2 = LEFT(TM2,2)
    ASSIGN/H2S_B = (H2)*3600
    ASSIGN/M2S_B = (M2)*60
    ASSIGN/TO_SC_2 = (H2S_B)+(M2S_B)+(S2)
    $$ NO,' end cntr segment one
    $$ NO,'
    $$ NO,'
    $$ NO,'
    $$ NO,' start cntr segment two
    ASSIGN/TM1 = SYSTEMTIME("HH':'mm':'ss")
    ASSIGN/S1 = RIGHT(TM1,2)
    ASSIGN/M1 = MID(TM1,3,2)
    ASSIGN/H1 = LEFT(TM1,2)
    ASSIGN/H2S_A = (H1)*3600
    ASSIGN/M2S_A = (M1)*60
    ASSIGN/TO_SC_1 = (H2S_A)+(M2S_A)+(S1)
    ASSIGN/EL_SEC = (TO_SC_1)-(TO_SC_2)
    ASSIGN/EL_MIN = (EL_SEC)/60
    FPTR =FILE/OPEN,C:\USAGE\FPTR.TXT,APPEND
    FILE/WRITE_BLOCK,FPTR,"START TIME "
    FILE/WRITE_BLOCK,FPTR,TM2
    FILE/WRITE_BLOCK,FPTR," MINUTES MEASURING "
    FILE/WRITE_BLOCK,FPTR,EL_MIN
    FILE/WRITELINE,FPTR," "
    FILE/ CLOSE
    $$ NO,' end cntr segment two
    $$ NO,'
    $$ NO,'


    Just an FYI on this code.

    IT WORKS GREAT!

    I've got in running on the 4 CMMs and have had no problems with. I did add the FILE/CLOSE at the end of it since we have various machines running to it.

    Thank you Mark.
Children
No Data