Spencer, I use counters in my Mach3 program and have attached some jpg's of the macros and Mach3 modified screen. I am using only the X & Z axis. It is actually a lathe running mach3 mill. The main screen has 3 counters using DRO's. The top one under the Z axis counts up the number of cycles run i.e. the number of parts made. It retains information during a shutdown of Mach3 and is reset by clicking the mouse on it and entering 0. Since I am running a 6 ft 3/8" aluminum rod in the bar feeder to make 5/8" parts, I have the next counter down set at the number of counts left in the bar after it passes a switch before the headstock. This counter stops the lathe before the bar cannot be securely held in the collet and break a cutter. The bottom counter just loads the number of cuts in the loop and decrements with each cut. The 5 vars on the right are used to make minor adjustments to 5 things on the lathe per the wording on the spaces. I have included a snapshot of my G Code so you can see when the Macros are called to set the counters. Hope this helps, Ross ![]()
G Code file.jpg
![]()
M1000 increment DRO 1000.jpg
![]()
M1002 set vars.jpg
![]()
M1020 set decrementing counter.jpg
![]()
M1022 checks decrementing counter and stops at 0.jpg
![]()
Mach3 Screen modified.jpg
|