CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > Mach Software (ArtSoft software) > Mach Wizards, Macros, & Addons



This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-10-2009, 02:30 PM
 
Join Date: Jun 2006
Location: USA
Posts: 47
Dan Craig is on a distinguished road
Is a Macro what I want...if not what is?

Hi everyone,
I've got my small router working under Mach3 and now I need to write a program to create g-code for a specific engraving job which I will perform regularly (this isn't a one-off).

I need to engrave a scale on anodized alum bar stock. Determining my x y and z coordinates is easy enough. At this point I'm trying to determine what the fastest way to put a value on various increments of the scale is - (For example a scale which has increments between 200 and 900 by 100 - so the bottom of the scale is 200 next increment is 300, etc. ) because I'll need these numbers at various times throughout each engraving job. Because, I'll need an array of different numbers, maybe being able to call a "2" and a "0" twice is my best choice so I can mix and match values?

If a macro is the best way - where would I get the g-code to engrave "200" to fill the macro? and then how would I call it in my program in order to start the "200" at any given coordinate? (I haven't yet but can purchase the add-ons so I can use the write wizard.)

Am I making sense? I guess it's like a canned cycle, but those are specifically for drilling and tapping as far as I could tell from the manual.

I can certainly explain further, but I want to see if I'm even barking up the right tree.

Many Thanks-
Reply With Quote

  #2  
Old 04-10-2009, 06:44 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,456
ger21 is on a distinguished road
Buy me a Beer?

First, you don't need to purchase anything to use the Write wizard. It's free, as are most of the Wizards. Only the Newfangled Solutions addons require a license.

I'd say that your best bet would be to write a VB macro to do what you want.
You'll need the macro to create the g-code for the numbers, or possibly call them from other macros. If you don't have any VB experience, you may be in for a steep learning curve. Or maybe not.

Depending on how many different numbers you'll need, then yes, it may be easier to do individual digits, rather than complete numbers.

You probably have more questions now?
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #3   Ban this user!
Old 04-10-2009, 07:48 PM
 
Join Date: Jun 2006
Location: USA
Posts: 47
Dan Craig is on a distinguished road

thanks Gerry, I do have more questions and unfortunately my web searches aren't revealing much - to me at least.

I am fairly familiar with VB so that part should be ok. I'm using a form in Access to take custom coordinates for various scales and then programatically create gcode files for me based on coordinates I enter. (The horizontal lines on the scale are simple moves and quick to assemble in a text file.)

As far as how many numbers I need to engrave - one scale goes in inches 0-60 with numbers at each inch - then another is 0-31 - another is 0-11 - another type of scale has numbers from about 50 up to 5000 in various increments...so probably it's best to set up each individual digit and just combine digits.

I still don't understand how I position the digits where I want them. Is this the time to use G52? Or is there another G code which will *add* the values of the following group of Gcodes to the DRO positions - instead of returning the spindle back to 0,0 and working from there?

Has anyone else done something like this - and documented it on the web somewhere? I'm trying to understand what the likely workflow is. Do I need to create an individual gcode file for each digit or can I create a single file with subroutines for each digit or number which can be called while the program is running?

Also, is there more documentation on Macros online? I read about them in the manual and came away with an overview of what they are - not so much what can be done with them. I'm definitely going to read about them again, but extra info isn't going to hurt me here.
Reply With Quote

  #4  
Old 04-10-2009, 08:05 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,456
ger21 is on a distinguished road
Buy me a Beer?

Not real familiar with G52, but it looks like you could do it. Maybe also use incremental code to do the numbers? You know where you want them, so positioning them should be fairly straightforward, once you have the g-code for them and you know what size they are. And know how you're going to do them. Basically, you keep track of where you are, move to the numbers start position, and either create the code and run it, or call it from an external file. Then move to the next position and repeat.

The Mach2 customization guide should have some examples, but are probably a bit outdated. The Wiki has most of the functions listed.
http://www.machsupport.com/MachCusto...itle=Main_Page

You can also find a lot of example code on the Mach forum, if you poke around.
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #5   Ban this user!
Old 04-10-2009, 08:11 PM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,041
Kiwi is on a distinguished road

Please post a drawing of the layout and text font/size you require.
If a standalone VB program generated the code, would downloading to your controller be workable.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-11-2009, 01:16 PM
 
Join Date: Jun 2006
Location: USA
Posts: 47
Dan Craig is on a distinguished road

Originally Posted by Kiwi View Post
Please post a drawing of the layout and text font/size you require.
If a standalone VB program generated the code, would downloading to your controller be workable.
Downloading to the controller will be via usb thumb drive.

I'm not sure I understand what you want to learn from a drawing.
Reply With Quote

  #7   Ban this user!
Old 04-11-2009, 04:57 PM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,041
Kiwi is on a distinguished road

Originally Posted by Dan Craig View Post
I'm not sure I understand what you want to learn from a drawing.
Font size and style.
Layout, are the numbers side by side or one under the other.
Do they lineup, left side, right side.
Reply With Quote

  #8   Ban this user!
Old 04-11-2009, 08:24 PM
 
Join Date: Jun 2006
Location: USA
Posts: 47
Dan Craig is on a distinguished road

oh, sure, of course. I don't know why I didn't quite understand.

I'll make a sketch a little later this evening.

I've been reading about sub-routines at the mach support site and it seems that might be the way I should go - combine that with g52 (iirc) and locate the numbers I want where I want them.

Advantageously, the numbers for the various items I'll be engraving will be the same size height wise - so I can re-use the same code for them where necessary. Because I know what all the different number combinations will be, it seems wisest to create subroutine files with each number I'll need to engrave and then just call them as needed while creating the g-code.

I'll get a sketch of the scale up later on and thanks for bearing with me as I delve into stuff I've never thought seriously about how to implement - though I know it's possible to implement.
Reply With Quote

  #9   Ban this user!
Old 04-12-2009, 03:24 AM
 
Join Date: Jun 2006
Location: USA
Posts: 47
Dan Craig is on a distinguished road

I haven't had the opportunity to draw a sketch, but here's a representative picture. The anodized bar is 1" wide.

The numbers will be located just above their respective line because two scales will be engraved on a single bar for some orders. Making the whole line .375", the half line .25" and the tenth line .125" and still leaving a clear separation down the middle.

I haven't measured the text in height but it's probably .375" or so. As for font style - something stick or simple - no serifs or fancy stuff. Clear and readable is all we're looking for.

I do know that I don't want the number touching it's line, I'd like a small bit of empty space above the line, below the number. How much space will really depend on how fine a line my engraving cutters will give me. As for depth - I was thinking .030" but I haven't been able to take any test cuts with the engraving bits yet.

Does that help give an overview of what I'm working toward?
Attached Thumbnails
Click image for larger version

Name:	image1.jpg‎
Views:	89
Size:	83.8 KB
ID:	79571  
Reply With Quote

  #10   Ban this user!
Old 04-12-2009, 04:09 PM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,041
Kiwi is on a distinguished road

Dan
Is the bar to be held along the X axis or Y axis while machining?
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 04-12-2009, 05:29 PM
 
Join Date: Jun 2006
Location: USA
Posts: 47
Dan Craig is on a distinguished road

I'm planning a simple fixture which will allow the bar to be held lengthwise along the X.

But back to my original question - is G52 the code which is appropriate for locating/offsetting the spindle when I go to engrave the text?

As in - I'll have a series of .tap files with g-code for a sequence of digits or text. I've already determined where each horizontal line goes and plan to either intersperse the number subroutines with M98 as I work along the X axis (likely a better use of time) or go back and call the subroutines after engraving all the horizontal lines and engrave the numbers.

The thing I want to confirm though is that G52 will allow my subroutine file to have origins at x0 y0 and will, based on my calculated offset, put the text in the desired location.
Reply With Quote

  #12   Ban this user!
Old 04-13-2009, 06:17 AM
 
Join Date: Jul 2003
Location: New Zealand
Posts: 1,041
Kiwi is on a distinguished road

Originally Posted by Dan Craig View Post
....But back to my original question - is G52 the code which is appropriate for locating/offsetting the spindle when I go to engrave the text?....
Sorry not much help with advice using G52 or writing a Macro.
I had a play and wrote a VB program. I'm sure there is room for improvements.
Attached Files
File Type: zip Numbers to GCode.zip‎ (13.3 KB, 66 views)
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"difference between Custom Macro A and Custom Macro B" arulthambi Parametric Programing 4 10-05-2009 03:34 PM
Need help with macro?????? lokey Mach Mill 1 04-27-2009 10:04 PM
Testing program for Macro (Fanuc Macro B) NickDP Fanuc 2 03-27-2009 03:15 PM
Convert Fanuc Macro to Fadal Macro bfoster59 Fadal 1 11-08-2007 11:41 PM
Macro gm3211 Mazak, Mitsubishi, Mazatrol 2 09-06-2007 07:02 AM




All times are GMT -5. The time now is 03:13 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361