Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 12:51:59 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
Is it possible to have an elapsed time display for VB code?
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Is it possible to have an elapsed time display for VB code? (Read 2209 times)
0 Members and 1 Guest are viewing this topic.
Darc
Active Member
Offline
Posts: 177
Is it possible to have an elapsed time display for VB code?
«
on:
April 15, 2007, 07:34:02 PM »
I have multiple buttons that run a different program each (see pic), is it possible to have a display that shows how long it has taken from start to finish for the VB script each time it is run.
The display I currently have will only display the time of a loaded program that runs.
Is there a way to do this?
Darc2.jpg
(55.53 KB, 786x570 - viewed 297 times.)
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #1 on:
April 16, 2007, 06:08:14 PM »
Yea, here you go Darc:
'Drop you a User Dro numbered 1200 or what ever, change code below to reflect new number. I put some sample moves in for you to see, how it times how long the script takes to run the code, notice the get timer(0) is at the end of the script to give you culamative time.
settimer(0)
Code "G0 x2"
Code "G0 x0"
code "M30"
While IsMoving()
Wend
x=GetTimer(0)
SetUserDRO(1200,x)
'Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Darc
Active Member
Offline
Posts: 177
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #2 on:
April 16, 2007, 09:00:10 PM »
Thanks Scott.
Works beautifully, just what I was after.
Thanks again.
Logged
Darc
Active Member
Offline
Posts: 177
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #3 on:
April 17, 2007, 04:28:49 PM »
Hi poppabear, just a quick question regarding the code, whenever I have the timer in my program, it works great.
The only problem I have found is that the spindle won't start, even though there is an M03 in the script.
During the running of the cycle, if I press esc it displays terminating script and then starts the spindle?
??
If I remove the code the spindle works as per normal.......nah nah nah nah (twilight zone).
Any ideas
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #4 on:
April 17, 2007, 07:40:38 PM »
Hey Darc,
there was some noise about, you can't (or shouldn't call), a macro from within a macro.
So, what I would do, is get the Output pin that your M3 controls and just control the output specifically.
i.e.
ActivateSignal(OUTPUT1) 'change to whatever output your M3 triggers.
'If that STILL, doesn't work, then the question becomes a "Art or Brian" question, since it may have something to do with
'how Mach parses the code or some other internal issue.
Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Darc
Active Member
Offline
Posts: 177
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #5 on:
April 17, 2007, 10:58:18 PM »
Thanks heaps, it works treat now..
Logged
sunmix
Active Member
Offline
Posts: 35
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #6 on:
April 26, 2007, 11:36:01 AM »
hey hi everyone, i've tried it in my mach, for example the code for Macro M3 is like this:
settimer(0)
Code "G0 x2"
Code "G0 x0"
Code "G4 P" & (getUserDRO(1001))
While IsMoving()
Wend
ActivateSignal(Output1)
x=GetTimer(0)
SetUserDRO(1002,x)
DRO 1001 is the time that i've set for it to count : for example 10 seconds.
DRO 1002 is the elapsed time that it would show after the action is completed.
When i type M3 on my MDI, it triggers the macro,
and during this process, it should be running for about 16-20seconds.
instead the DR0 1002 shows out 1.6164. what have I went wrong?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #7 on:
April 26, 2007, 04:40:40 PM »
get you code, OUT, of the m3 macro, that is for spindle clockwise.
Make a Custom Macro, that you post after you post the M3 if you want them close together.
Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
sunmix
Active Member
Offline
Posts: 35
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #8 on:
April 27, 2007, 08:13:06 AM »
Scott,
I don't quite understand what do you mean, it was just an example, my real code was for controlling heights and delays for my oxy/plasma.
what did u mean by " Post after you Post the M3 if you want them close together"?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Is it possible to have an elapsed time display for VB code?
«
Reply #9 on:
April 28, 2007, 06:35:10 AM »
Look at your "G4" settings in your general config, make sure your pauses are set to seconds, not micro seconds.
I meant, after your g-code puts out a m3, the next m code should be this one that you want special stuff, it you want it tied close to your m3.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Pages:
1
2
»
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.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****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
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...