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, 01:27:04 AM
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
Marco gone wild.
Pages:
1
Go Down
« previous
next »
Author
Topic: Marco gone wild. (Read 555 times)
0 Members and 1 Guest are viewing this topic.
dfurlano
Active Member
Offline
Posts: 246
Marco gone wild.
«
on:
July 05, 2011, 05:10:20 PM »
Been struggling all weekend trying to figure this out.
If I go to the offset menu and click the ref all home the Z,X,Y,A home with no problems.
If I click the button on my home page to run the macro below I get random behavior. Mostly the Z rapids down but once in a while the Z will rapid up and then about half the macro will run.
If I open the macro using the edit button script command and run the macro line by line it runs flawlessly.
This system has been running with no issues for a few years. It all started with a dumbass move on my part that crashed the system. The only difference is that I added the DoOEMButton command to the macro.
I also tried reinstalling Mach.
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
Code "G54"
Code "G90"
DoButton( 24 )
DoOEMButton 1010
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
Code "G90 G0 Z-2.75"
While ismoving()
Wend
Code "G90 G31 Z-4 F4" 'probing move, can set the feed rate here as well as how far to move
While ismoving()
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
While ismoving()
Sleep 100
Wend
Code "G90 G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While ismoving()
Sleep 100
Wend
Zoffset = getvar(5223)
Cline = (ZProbePos+-3.2395) '-3.2395 Distance between center line of rotary and probe
SetVar(5243,(Cline+PlateThickness))'Set G55 Z
While ismoving()
Wend
SetVar(5263,(Cline+PlateThickness))'Set G56 Z
While ismoving()
Wend
SetVar(5283,(Cline+PlateThickness))'Set G57 Z
While ismoving()
Wend
Code "G91"
Code "G0 Z 0.1" 'retract
While ismoving()
Sleep 100
Wend
Code "G55"
Code "G90"
While ismoving()
Sleep 100
Wend
Code "G0 X0 Y0" 'move to start position
While ismoving()
Sleep 100
Wend
Code "(Z axis is now zeroed for G55, G56, G57)" 'puts this message in the status bar
Exit Sub
Logged
ger21
Global Moderator
Offline
Posts: 2,619
Re: Marco gone wild.
«
Reply #1 on:
July 05, 2011, 05:33:32 PM »
Try This:
Sub Main()
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
Code "G54"
Code "G90"
DoButton( 24 )
DoOEMButton 1010
Sleep (250)
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
Code "G90 G0 Z-2.75"
While ismoving()
Wend
Code "G90 G31 Z-4 F4" 'probing move, can set the feed rate here as well as how far to move
While ismoving()
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Sleep(150)
Code "G90 G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While ismoving()
Wend
Zoffset = getvar(5223)
Cline = (ZProbePos-3.2395) '-3.2395 Distance between center line of rotary and probe
SetVar(5243,(Cline+PlateThickness))'Set G55 Z
SetVar(5263,(Cline+PlateThickness))'Set G56 Z
SetVar(5283,(Cline+PlateThickness))'Set G57 Z
Code "G91"
Code "G0 Z0.1" 'retract
While ismoving()
Wend
Code "G55"
Code "G90"
Code "G0 X0 Y0" 'move to start position
While ismoving()
Wend
Message "Z axis is now zeroed for G55, G56, G57" 'puts this message in the status bar
End Sub
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
dfurlano
Active Member
Offline
Posts: 246
Re: Marco gone wild.
«
Reply #2 on:
July 05, 2011, 06:24:24 PM »
It homes now but does not Zero the Z axis. Also takes off in the Z and X at Code "G90 G0 Z-2.75"
Logged
dfurlano
Active Member
Offline
Posts: 246
Re: Marco gone wild.
«
Reply #3 on:
July 05, 2011, 07:17:03 PM »
Got it to work! Thanks for the help! I moved the DoOEMButton and added a ismoving. It would not take the Sub Main statement.
w00t!
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
Code "G54"
Code "G90"
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
While ismoving ()
Wend
DoOEMButton(1010)
While ismoving ()
Wend
Code "G90 G0 Z-2.75"
While ismoving()
Wend
Code "G90 G31 Z-4 F4" 'probing move, can set the feed rate here as well as how far to move
While ismoving()
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
While ismoving()
Sleep 100
Wend
Code "G90 G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While ismoving()
Sleep 100
Wend
Zoffset = getvar(5223)
Cline = (ZProbePos+-3.2395) '-3.2395 Distance between center line of rotary and probe
SetVar(5243,(Cline+PlateThickness))'Set G55 Z
While ismoving()
Wend
SetVar(5263,(Cline+PlateThickness))'Set G56 Z
While ismoving()
Wend
SetVar(5283,(Cline+PlateThickness))'Set G57 Z
While ismoving()
Wend
Code "G91"
Code "G0 Z 0.1" 'retract
While ismoving()
Sleep 100
Wend
Code "G55"
Code "G90"
While ismoving()
Sleep 100
Wend
Code "G0 X0 Y0" 'move to start position
While ismoving()
Sleep 100
Wend
Code "(Z axis is now zeroed for G55, G56, G57)" 'puts this message in the status bar
Exit Sub
Logged
ger21
Global Moderator
Offline
Posts: 2,619
Re: Macro gone wild.
«
Reply #4 on:
July 05, 2011, 07:20:11 PM »
DoOemButton 1010 should be
DoOemButton(1010)
I missed that.
When a macro messes up, sometimes it's a good idea to close Mach3 and reboot the PC, as macros may not run correctly again until you do this.
How about this?
Sub Main()
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
ProbeDepth = (GetOEMDro(802) - 4 ) ' Probe move to current Z - 4
Code "G54"
Code "G90"
DoButton( 24 )
DoOEMButton (1010)
Sleep (250)
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
Code "G0 Z-2.75"
While IsMoving()
Wend
Code "G90 G31 Z" & ProbeDepth & " F4" 'probing move, can set the feed rate here
While IsMoving()
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Sleep(150)
Code "G90 G0 Z" & ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving()
Wend
Zoffset = getvar(5223)
Cline = (ZProbePos-3.2395) '-3.2395 Distance between center line of rotary and probe
SetVar(5243,(Cline+PlateThickness))'Set G55 Z
SetVar(5263,(Cline+PlateThickness))'Set G56 Z
SetVar(5283,(Cline+PlateThickness))'Set G57 Z
Code "G91"
Code "G0 Z0.1" 'retract
While IsMoving()
Wend
Code "G55"
Code "G90"
Code "G0 X0 Y0" 'move to start position
While ismoving()
Wend
Message "Z axis is now zeroed for G55, G56, G57" 'puts this message in the status bar
End Sub
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
dfurlano
Active Member
Offline
Posts: 246
Re: Marco gone wild.
«
Reply #5 on:
July 05, 2011, 08:54:46 PM »
Very true on the restart. Thanks again for your help.
Dan
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Marco gone wild.
«
Reply #6 on:
July 06, 2011, 05:36:08 AM »
Quote from: ger21 on July 05, 2011, 07:20:11 PM
When a macro messes up, sometimes it's a good idea to close Mach3 and reboot the PC, as macros may not run correctly again until you do this.
Are you sure about this? I've done a fair amount of programming in Mach3 and haven't observed this, and I have had scripts screw up (over, and over, and over, especially on the Egg Shape Wizard!). I always hit cycle stop a few times and reset twice and everything seems fine again.... What have your observations been?
I'm actually really curious because you have a lot of experience, certainly more than me!
Logged
ger21
Global Moderator
Offline
Posts: 2,619
Re: Marco gone wild.
«
Reply #7 on:
July 06, 2011, 06:06:31 AM »
I probably should have worded that differently.
I've seen issues when having to estop during a macro, where the machine would no longer home correctly afterwards, just crashing through the home switches, and the macro would no longer run afterwards, until re-booting the PC.
I'm sure this isn't the case all the time. What I'm saying, is that if Mach3 doesn't appear to be acting correctly, then close it and re-booting should clear it up.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
Sargon
Active Member
Offline
Posts: 99
Re: Marco gone wild.
«
Reply #8 on:
July 06, 2011, 07:33:10 PM »
Thanks for the clarification Ger.
Have a great day/night!
Chris
«
Last Edit: July 06, 2011, 07:34:59 PM by Sargon
»
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.
===> 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...