hexagon logo

Feature Run Timer

I got this from another on here and edited it very little but thought it worthy of posting in here.

This will give the total amount of time (in minutes) for any number of features to run on the CMM.

ASSIGN/TIME1=SYSTEMTIME("HH':'mm':'ss")
            ASSIGN/SEC1=RIGHT(TIME1,2)
            ASSIGN/MIN1=MID(TIME1,3,2)
            ASSIGN/HOUR1=LEFT(TIME1,2)
            ASSIGN/HOUR_TO_SEC_1=(HOUR1)*3600
            ASSIGN/MIN_TO_SEC_1=(MIN1)*60
            ASSIGN/TOTAL_SEC_1=(HOUR_TO_SEC_1)+(MIN_TO_SEC_1)+(SEC1)
$$ NO,add features here
            MOVE/INCREMENT,<0,0,500>
PNT1       =FEAT/CONTACT/VECTOR POINT,CARTESIAN
            THEO/<0,0,0>,<0,0,1>
            ACTL/<0,0,0>,<0,0,1>
            TARG/<0,0,0>,<0,0,1>
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            MOVE/INCREMENT,<0,0,500>
PNT2       =FEAT/CONTACT/VECTOR POINT,CARTESIAN
            THEO/<10,0,0>,<0,0,1>
            ACTL/<10,0,0>,<0,0,1>
            TARG/<10,0,0>,<0,0,1>
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            MOVE/INCREMENT,<0,0,500>
PNT3       =FEAT/CONTACT/VECTOR POINT,CARTESIAN
            THEO/<20,0,0>,<0,0,1>
            ACTL/<20,0,0>,<0,0,1>
            TARG/<20,0,0>,<0,0,1>
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            MOVE/INCREMENT,<0,0,500>
$$ NO,Add dimension of last feature to force PC-DMIS 
     ,to "catch up" before reporting end time.
     ,Set output to NONE
DIM LOCTIME1= LOCATION OF POINT PNT1  UNITS=MM ,$
GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=NONE
AX       MEAS    NOMINAL       +TOL       -TOL        DEV     OUTTOL
X       0.000      0.000      0.800      0.800      0.000      0.000 --#---
END OF DIMENSION LOCTIME1
            ASSIGN/TIME2=SYSTEMTIME("HH':'mm':'ss")
            ASSIGN/SEC2=RIGHT(TIME2,2)
            ASSIGN/MIN2=MID(TIME2,3,2)
            ASSIGN/HOUR2=LEFT(TIME2,2)
            ASSIGN/HOUR_TO_SEC_2=(HOUR2)*3600
            ASSIGN/MIN_TO_SEC_2=(MIN2)*60
            ASSIGN/TOTAL_SEC_2=(HOUR_TO_SEC_2)+(MIN_TO_SEC_2)+(SEC2)
            ASSIGN/ELAPSED_SEC=(TOTAL_SEC_2)-(TOTAL_SEC_1)
            ASSIGN/ELAPSED_MIN=(ELAPSED_SEC)/60
            COMMENT/OPER,YES,"The elasped time to run the feature(s) was " + ELAPSED_MIN + " minutes."
Parents
  • I have seen alot of these types of additions to programs. How would I make this work in my programs? I would like to try it on some of the longer program.


    1) Copy what Inspect.212 posted into a Word or Notepad doc, then save it. You can skip the points. I have a folder full of this stuff, and I always include who wrote it. Print it out.

    2) Open your long program, file-save-as a new version (make this a serious habit for doing any editing!!!!)

    3) At the beginning of the program, start inserting the new lines of code which are Assignments. Follow the syntax exactly - especially the lower case mm and ss. Be very exact with the names.
    ASSIGN/TIME1=SYSTEMTIME("HH':'mm':'ss")
                ASSIGN/SEC1=RIGHT(TIME1,2)
                ASSIGN/MIN1=MID(TIME1,3,2)
                ASSIGN/HOUR1=LEFT(TIME1,2)
                ASSIGN/HOUR_TO_SEC_1=(HOUR1)*3600
                ASSIGN/MIN_TO_SEC_1=(MIN1)*60
                ASSIGN/TOTAL_SEC_1=(HOUR_TO_SEC_1)+(MIN_TO_SEC_1)+(SEC1)
    


    4) When you're done, copy that whole block of new lines and paste them at the end of the program. Now edit the pasted lines to change all the 1s to 2s.
    ASSIGN/TIME2=SYSTEMTIME("HH':'mm':'ss")
                ASSIGN/SEC2=RIGHT(TIME2,2)
                ASSIGN/MIN2=MID(TIME2,3,2)
                ASSIGN/HOUR2=LEFT(TIME2,2)
                ASSIGN/HOUR_TO_SEC_2=(HOUR2)*3600
                ASSIGN/MIN_TO_SEC_2=(MIN2)*60
                ASSIGN/TOTAL_SEC_2=(HOUR_TO_SEC_2)+(MIN_TO_SEC_2)+(SEC2
    


    5) Insert the 2 unique lines at the very end - the ones that do the math to calculate the elapsed time.
    ASSIGN/ELAPSED_SEC=(TOTAL_SEC_2)-(TOTAL_SEC_1)
                ASSIGN/ELAPSED_MIN=(ELAPSED_SEC)/60
    


    6) Make an operator comment that pops up and tells you how much time passed.
    COMMENT/OPER,YES,"The elasped time to run the feature(s) was " 
    ELAPSED_MIN
    ...
    


    Alternately, you could write both sections as scripts and have any program run them.
Reply
  • I have seen alot of these types of additions to programs. How would I make this work in my programs? I would like to try it on some of the longer program.


    1) Copy what Inspect.212 posted into a Word or Notepad doc, then save it. You can skip the points. I have a folder full of this stuff, and I always include who wrote it. Print it out.

    2) Open your long program, file-save-as a new version (make this a serious habit for doing any editing!!!!)

    3) At the beginning of the program, start inserting the new lines of code which are Assignments. Follow the syntax exactly - especially the lower case mm and ss. Be very exact with the names.
    ASSIGN/TIME1=SYSTEMTIME("HH':'mm':'ss")
                ASSIGN/SEC1=RIGHT(TIME1,2)
                ASSIGN/MIN1=MID(TIME1,3,2)
                ASSIGN/HOUR1=LEFT(TIME1,2)
                ASSIGN/HOUR_TO_SEC_1=(HOUR1)*3600
                ASSIGN/MIN_TO_SEC_1=(MIN1)*60
                ASSIGN/TOTAL_SEC_1=(HOUR_TO_SEC_1)+(MIN_TO_SEC_1)+(SEC1)
    


    4) When you're done, copy that whole block of new lines and paste them at the end of the program. Now edit the pasted lines to change all the 1s to 2s.
    ASSIGN/TIME2=SYSTEMTIME("HH':'mm':'ss")
                ASSIGN/SEC2=RIGHT(TIME2,2)
                ASSIGN/MIN2=MID(TIME2,3,2)
                ASSIGN/HOUR2=LEFT(TIME2,2)
                ASSIGN/HOUR_TO_SEC_2=(HOUR2)*3600
                ASSIGN/MIN_TO_SEC_2=(MIN2)*60
                ASSIGN/TOTAL_SEC_2=(HOUR_TO_SEC_2)+(MIN_TO_SEC_2)+(SEC2
    


    5) Insert the 2 unique lines at the very end - the ones that do the math to calculate the elapsed time.
    ASSIGN/ELAPSED_SEC=(TOTAL_SEC_2)-(TOTAL_SEC_1)
                ASSIGN/ELAPSED_MIN=(ELAPSED_SEC)/60
    


    6) Make an operator comment that pops up and tells you how much time passed.
    COMMENT/OPER,YES,"The elasped time to run the feature(s) was " 
    ELAPSED_MIN
    ...
    


    Alternately, you could write both sections as scripts and have any program run them.
Children
No Data