Program time

User avatar
RodGarrett
Nikon
Nikon
Posts: 7
Joined: Thu Feb 24, 2011 7:42 pm

Re: Program time

Post by RodGarrett » Fri May 20, 2016 8:46 am

Hi Nate,

I am hoping to export program runtime via DDE to record accumulated run times. When I export the format from the sample file into MS Excel it does not allow me to perform a sum calculation even after formatting the cells to hh:min:sec.

Any suggestions on what I could change?


Thanks

User avatar
RodGarrett
Nikon
Nikon
Posts: 7
Joined: Thu Feb 24, 2011 7:42 pm

Re: Program time

Post by RodGarrett » Fri May 20, 2016 9:44 am

I changed the script in the following way and it works fine now.

hms = IntHrs & " :" & IntMin & " :" & IntSec & " "

User avatar
CrashN8
Site Admin
Site Admin
Posts: 371
Joined: Thu Feb 09, 2017 4:07 pm

Re: Program time

Post by CrashN8 » Thu Apr 12, 2018 3:01 pm

Huge Update for this...

I've created an Excel spreadsheet that collects a time-stamp and run duration entry for each program execution. You will need to add three lines to each CMM-Manager program in order to use this Excel report. You could simply use the attached CMM-Manager program as a template.

At beginning of program as VB Script:

Code: Select all

fromDate = (Format(now, "mm-dd-yy hh:mm:ss"))
Then at end of program add another VB Script:

Code: Select all

toDate = (Format(now, "mm-dd-yy hh:mm:ss"))
MyDiff = DateDiff("s",fromDate,toDate)

IntHrs = Int(MyDiff / 3600)
Hrs = MyDiff / 3600
IntMin = Int((Hrs - IntHrs) * 60)
Min = (Hrs - IntHrs) * 60
IntSec = Int((Min - IntMin) * 60)

hmsRpt = IntHrs & " Hrs: " & IntMin & " Min: " & IntSec & " Sec"
hms = IntHrs & ":" & IntMin & ":" & IntSec
Finally, add a DDE operation like this - notice the variable name from VB Script is used for DDE output:
DDE_utilization_report.jpg
See next image... CMM-Manager data is written to area highlighted in Orange. User can choose number of hours per shift / day in Green area. Choose number of Days, Weeks, Months, etc from area in Blue. Choose Custom drop-down option and then create custom date range in Purple area.
DDE_utilization_report_Excel.jpg
Enjoy:)
You do not have the required permissions to view the files attached to this post.

Post Reply