Home
Downloads
Mach and LazyCam
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
German Forum
Italian Forum
Portugese Forum
Resources
Links
User Reviews
User Videos
Contact Us
CNCZone
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
December 02, 2008, 04:16:02 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Here is a TRUE part Elapsed time, date file creator macros
Pages:
1
Go Down
« previous
next »
Author
Topic: Here is a TRUE part Elapsed time, date file creator macros (Read 733 times)
0 Members and 1 Guest are viewing this topic.
poppabear
S S SYSTEMS, LLC
Global Moderator
Online
Posts: 770
Briceville, TN, USA
Here is a TRUE part Elapsed time, date file creator macros
«
on:
June 26, 2008, 03:40:30 PM »
Ok, here is a solution, It doesnt take into account of changing from the last day of one month, and the start of another.
Also, the same for Year Changes, it only takes into account Consecutive days in the same month.
Also The "CostEstimate.txt" File, will create itself in the Mach3 main directory.
If you want it to create some where else, you will need to change the path to where you want it to drop.
NOTE: The intermediate file "Time File" will create and destroy itself with the complete running of the G-Code part file.
What this does is create a file, called: "CostEstimate.txt" This text shows Start Time and Date, End Time and Date, and total elapsed time on that part for: Days, Hours, Minutes, Seconds
This is TRUE elapsed time while on that part, so if you pause your G-Code for 1 hour then come back and hit cycle start, then it will add that hour to the program.
Things you will have to do for Setup:
1). You will have to change your computers System time to 24 hour clock for the time calculation to work.
2). You will need to put the Macro "M1002" at least one line down from the start of your code, and before your part starts. (the line above it can be a comment), or Init G codes.
3). You will need to put the Macro "M1003" right before your last line, which should be a M30.
Other Things:
1). You will need to run the file completly from start to finish, since these to Macros are linked to create and destroy it intermediates.
2). Once you run a part, you will have to Copy and MOVE that file, out of that area, and Print it off, If you run that same part, or some other part, the next run will delete that file, and recreate it at the end, with the new times from start to finish.
Here is the Start Timer, Date, Macro: M1002.m1s
'****************************
'M1002.m1s Store Start time point
Open "CostEstimate.txt" For Output As #2
Close #2
Kill "CostEstimate.txt"
Dim StartTime As String
Dim StartDate As String
StartTime = Time(Now)
StartDate = Date()
Open "TimeFile" For Output As #1 ' Open to write file.
Write #1, StartTime
Write #1, StartDate
Close #1
Code "G4 P0.5"
While IsMoving
Wend
Sec = Second(StartTime)
Min = Minute(StartTime)
Hr = Hour(StartTime)
Dy = Day(StartDate)
SetVar(100,Sec)
SetVar(101,Min)
SetVar(102,Hr)
SetVar(103,Dy)
'*****************************
Here is the End Timer, Date, Macro: M1003.m1s
'*****************************
'M1003.m1s Get End Time point and calc, and post file
Dim StartTime As String
Dim StartDate As String
Dim EndTime As String
Dim EndDate As String
Dim File As String
Dim Days
EndTime = Time(Now)
EndDate = Date()
SecEnd = Second(EndTime)
MinEnd = Minute(EndTime)
HrEnd = Hour(EndTime)
DyEnd = Day(EndDate)
SecStart = GetVar(100)
MinStart = GetVar(101)
HrStart = GetVar(102)
DyStart = GetVar(103)
File = FileName()
Open "TimeFile" For Input As #1 ' Open file.
Line Input #1, TextLine ' Read line into variable.
StartTime = TextLine ' get start time.
Line Input #1, TextLine ' Read line into variable.
StartDate = TextLine ' get start date.
Close #1 ' Close file.
Code "G4 P0.5"
While IsMoving
Wend
If HrEnd<HrStart Then
Hr=((24-HrStart)+(24-(24-HrEnd)))
Else
Hr=(HrEnd-HrStart)
End If
If MinEnd<MinStart Then
Min=((60-MinStart)+(60-(60-MinEnd)))
Else
Min=(MinEnd-MinStart)
End If
If SecEnd<SecStart Then
Sec=((60-SecStart)+(60-(60-SecEnd)))
Else
Sec=(SecEnd-SecStart)
End If
If (DyEnd-DyStart)= 0 Then
Days = 0
End If
If ((DyEnd-DyStart)=1) And (HrEnd<HrStart) Then
Days = 0
End If
If ((DyEnd-DyStart)=1) And (HrEnd>HrStart) Then
Days = 1
End If
If ((DyEnd-DyStart)>1) Then
Days = (DyEnd-DyStart)
End If
Kill "TimeFile"
Open "CostEstimate.txt" For Output As #2 ' Open to write file.
Write #2, "File Name: " & File
Write #2, "Start Time: " & StartTime, "Start Date: " & StartDate
Write #2, "End Time: " & EndTime, "End Date: " & EndDate
Write #2, "Total Time: " & " Days: " & Days & " Hours: " & Hr & " Mins: " & Min & " Secs: " & Sec
Close #2
Code "G4 P0.5"
While IsMoving
Wend
'*******************************************
'Hope this helps you
'Scott
Logged
All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
Chaoticone
South Carolina, US
Administrator
Online
Posts: 2,810
Precision Chaos
Re: Here is a TRUE part Elapsed time, date file creator macros
«
Reply #1 on:
June 26, 2008, 05:13:50 PM »
Thanks for shareing that with us Scott.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
vmax549
Active Member
Offline
Posts: 45
Re: Here is a TRUE part Elapsed time, date file creator macros
«
Reply #2 on:
July 01, 2008, 09:09:49 AM »
GOOD Job Scott, I have a project for YA. We could use a utility to see a LCAM project file AND print out a summary of the file. THings such as NAME,TOOL list, date, time to cut,etc,etc
(;-)TP
Logged
vmax549
Active Member
Offline
Posts: 45
Re: Here is a TRUE part Elapsed time, date file creator macros
«
Reply #3 on:
July 01, 2008, 10:22:26 AM »
Sorry Scott, I am just on here to help the HOBBY macherteers where I can. BUT then again I don't have to make a living at it.
Good Luck,
(;-) TP
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*e*i*n*g
=> Mach Screens
=> Feature Requests
=> Non English Forums
=> FAQs
===> Finished Plugins for Download
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> Lazy Cam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> dspMC/IP motion controller
=> Third party software and hardware support forums.
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Promote and discuss your product .
=> Sieg Machines
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
=> One on one phone support.
=> Forum suggestions and report forum problems.
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
Loading...