Display execution time, older pc dmis version

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JEFMAN
    replied
    Something like neil.challinor 's solution here :
    https://www.pcdmisforum.com/forum/pc...n-basic-script

    Leave a comment:


  • neil.challinor
    replied
    To do it all within your PC-Dmis program you would need to assign the time to a variable at the start of the program and assign the time to another variable at the end. That bit is easy - what's not so easy is doing the maths to work out how long the program was running. Generally, when I have tried to do similar things to this in the past, I have ended up having to convert each time from hours, minutes & seconds into an equivalent total number of seconds. You can then subtract the start time from the end time to give run time (in seconds) and convert this back into hours, minutes, seconds if desired. It ends up being quite a few lines of code which would obviously need to be added to every program. If you have access to visual studio and are proficient in coding then it would probably be better to write an application that launches PC-Dmis and then uses the OnStartExecution & OnEndExecution application events to record the run time. Your app could also add and populate a variable or comment within the program to store the run times. You could put some logic in there so that if the variable exists, it reads the run time and displays it as a message for the operator and if the variable doesn't exist, create it and record the time (as I've previously described).

    This is the code you would need to add inside the start and end of each PC-Dmis program to record the runtime.

    Code:
    At the beginning
    
    [LEFT][COLOR=#000000][FONT=Arial][SIZE=12px]            [/SIZE][/FONT][/COLOR][/LEFT]PART NAME  :
    [LEFT][COLOR=#000000][FONT=Arial][SIZE=12px]            [/SIZE][/FONT][/COLOR][/LEFT]REV NUMBER :
    [LEFT][COLOR=#000000][FONT=Arial][SIZE=12px]            [/SIZE][/FONT][/COLOR][/LEFT]SER NUMBER :
    [LEFT][COLOR=#000000][FONT=Arial][SIZE=12px]            [/SIZE][/FONT][/COLOR][/LEFT]STATS COUNT : 1
    
    [LEFT][COLOR=#000000][FONT=Arial][SIZE=12px]            [/SIZE][/FONT][/COLOR][/LEFT]STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                ASSIGN/STARTHOUR=(SYSTEMTIME("HH")*60)*60
                ASSIGN/STARTMIN=SYSTEMTIME("mm")*60
                ASSIGN/STARTSEC=SYSTEMTIME("ss")
                ASSIGN/STARTTIME=STARTHOUR+STARTMIN+STARTSEC
    
    
    the rest of your program goes here
    
    
    then at the end
    
                ASSIGN/ENDHOUR=(SYSTEMTIME("HH")*60)*60
                ASSIGN/ENDMIN=SYSTEMTIME("mm")*60
                ASSIGN/ENDSEC=SYSTEMTIME("ss")
                ASSIGN/ENDTIME=ENDHOUR+ENDMIN+ENDSEC
                ASSIGN/RUNTIME=ENDTIME-STARTTIME
                ROUTINE/END

    Leave a comment:


  • pcdmisstudent
    started a topic Display execution time, older pc dmis version

    Display execution time, older pc dmis version

    Hello all

    Im looking for a script of some sort to display the total runtime for a program. I know theres the "execution time" in newer versions of pc dmis, but i have 2011 so thats not an option for me.

    I heard about some assign/start time assign/ end time, can this display the total runtime for a program?
    I just want the operators to know how long the program will be running so they dont have to go in and check on it all the time.

    Thanks for replies

Related Topics

Collapse

Working...
X