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:38:52 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
counting iterations of macro
Pages:
1
Go Down
« previous
next »
Author
Topic: counting iterations of macro (Read 2643 times)
0 Members and 2 Guests are viewing this topic.
rayscott
Active Member
Offline
Posts: 6
counting iterations of macro
«
on:
June 16, 2008, 01:22:36 PM »
Hello all,
I am running programs that need to load a part, do movements, other stuff, move...etc... unload part, .. restart. For now, the operator watches the machine run for several hours as it loads and unloads from a magazine. I don't have a "part in magazine" detector and just want to tell the program to run 16 cycles. I am pretty good at writing macros.. How would I recall values of variables to count through 16 cycles?
Thank You,
Ray Scott
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: counting iterations of macro
«
Reply #1 on:
June 16, 2008, 01:31:11 PM »
you can run a "G code sub routine", or if you want you can use "Vars" to hold your counts.
SetVar(100, 16) will set the # 16 in the VAR 100,
GetVar(100) will get the value in VAR 100
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/
vmax549
Guest
Re: counting iterations of macro
«
Reply #2 on:
June 25, 2008, 10:14:55 AM »
Ray I believe that mach has a built in loop counter that runs with subloop.
DRO# 222
Hope that helps, (;-) TP
«
Last Edit: June 25, 2008, 10:20:11 AM by vmax549
»
Logged
zephyr9900
Active Member
Offline
Posts: 79
Re: counting iterations of macro
«
Reply #3 on:
January 09, 2010, 03:54:01 PM »
I realize that this is a very old thread, but it's the only information I've been able to find.
vmax549, thank you for the tip.
I've tried both OEM DRO 222 (Sub Program depth) and 78 (Repetitions DRO) without success.
My test program is
G18 (X-Z plane)
G20 (inch units)
G90 (absolute coordinates)
M98 P01 L6 (perform subroutine 01 6 times)
M30 (end program)
O01 (the subroutine)
G00 Z0.2500
G00 Z0.0000
M99 (return)
M30 (redundant end of program for safety)
I'm testing the DRO on my lathe, thus the G18. The DRO just stays at 0 and doesn't increment.
I just created a DRO on my run screen and assigned it OEM 222 (or 78). Is there something else I need to do or that I'm not doing right?
Randy
reps_DRO.gif
(18.76 KB, 522x587 - viewed 66 times.)
«
Last Edit: January 09, 2010, 03:59:12 PM by zephyr9900
»
Logged
Graham Waterworth
Administrator
Online
Posts: 1,665
West Yorkshire, England
Re: counting iterations of macro
«
Reply #4 on:
January 12, 2010, 07:00:34 AM »
If you set your DRO to 222 and run this program the DRO counts down to zero, you have to use a small delay to give mach time to update the DRO's.
Graham
%
G18 (X-Z plane)
G20 (inch units)
G90 (absolute coordinates)
M98 P01 L6 (perform subroutine 01 6 times)
M30 (end program)
O01 (the subroutine)
G00 Z0.2500
G00 Z0.0000
G4 P100
M99 (return)
%
«
Last Edit: January 12, 2010, 07:08:26 AM by Graham Waterworth
»
Logged
G-Code is on the cutting edge
Autovalues Engineering, CNC machining specialists, Bradford, England
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...