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."
  • Thanks, Inspector. I just verifed that my probe cal program takes 62.7 minutes to run.
  • 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.
  • 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.
  • JEC_31,

    I am going to try this. I will let you know if it works.
  • 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!!!!)

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


    I always do this when I am trying new stuff in proven programs.

    Now you are making my head hurt. Baby steps.

    OK, the program just ran and all I got was a comment that poped up and no time. I know I did something wrong but right know all I can think of is getting out of here for the three day weekend. I will work more on this next week.
  • I always do this when I am trying new stuff in proven programs..

    +1


    Now you are making my head hurt. Baby steps.

    LOL - I haven't done that more advanced step yet either. Baby steps = win.


    OK, the program just ran and all I got was a comment that poped up and no time. I know I did something wrong but right know all I can think of is getting out of here for the three day weekend. I will work more on this next week.

    1) Have a good 3-day Labor-free weekend!

    2) Ok, you're back to work. 1st make sure that the HH is capitals and the mm and ss are lower case. Then double-check all the variable names for typos.

    3) In the operator comment, re-type the variable ELAPSED_MIN. In my 4.3, the demon actually asks me if I mean to reference the variable. This way the value of the variable gets included in the pop-up.

    - Josh
  • +1


    LOL - I haven't done that more advanced step yet either. Baby steps = win.


    1) Have a good 3-day Labor-free weekend!

    2) Ok, you're back to work. 1st make sure that the HH is capitals and the mm and ss are lower case. Then double-check all the variable names for typos.

    3) In the operator comment, re-type the variable ELAPSED_MIN. In my 4.3, the demon actually asks me if I mean to reference the variable. This way the value of the variable gets included in the pop-up.

    - Josh




    This may be the problem. I am using 3.5MR2, and 3.7MR3

    Nope that was not the problem. I have it working now. Don't know what I did, but it is working.
    Now I am going to see if I can get it to print out on the inspection report. I am hopeing all I need to do is change the report type.

    Yes it works sending it to the report. I just change the output to report and it printed at the bottom of the report.

    (Sounds like I am talking to myself, and worse yet, I have answered myself twice.)
  • I wanted to try this to see what how it works.


    I entered it exactly as you said to (or so I think)


    This is at the beginning of program....

    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)




    This is at the end....


    ASSIGN/TIME2 = SYSTEMTIME("HH':'mm':'ss")
                ASSIGN/SEC2 = [COLOR="Red"]RIGHT(TIME2,2)[/COLOR]
                ASSIGN/MIN2 = [COLOR="Red"]MID(TIME2,3,2)[/COLOR]
                ASSIGN/HOUR2 = [COLOR="Red"]LEFT(TIME2,2)[/COLOR]
                ASSIGN/HOUR_TO_SEC_2 = [COLOR="Red"](HOUR2)*3600[/COLOR]
                ASSIGN/MIN_TO_SEC_2 = (MIN1)*60
                ASSIGN/TOTAL_SEC_2 = [COLOR="Red"](HOUR_TO_SEC_2)+(MIN_TO_SEC_2)+(SEC2)[/COLOR]
                ASSIGN/ELAPSED_SEC = (TOTAL_SEC_2)-(TOTAL_SEC_1)
                ASSIGN/ELAPSED_MIN = (ELAPSED_SEC)/60
                COMMENT/OPER,NO, 
                               ,The elapsed time to run this program was "+ELAPSED_MIN+" minutes
                               ,




    The stuff in red is showing up red in program. What's wrong with it? And why my comment pops up the end it just reads:

    The elapsed time to run this program was "+ELAPSED_MIN+" minutes


  • The elapsed time to run this program was "[COLOR=red]+ELAPSED[/COLOR][COLOR=red]_MIN+[/COLOR]" minutes


    I think you may be missing some spaces here. Compare to what I have. I have tomorrow off so I will try to get back to you on Monday.
  • Thank you very much for your assingment, i tried it works nice