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 Software (ArtSoft software) Discuss Mach 1 , 2 and the new Mach3 here NC software here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-12-2011, 12:55 PM
dertsap's Avatar
Gold Member
 
Join Date: Oct 2005
Location: canada
Posts: 3,668
dertsap is on a distinguished road
Buy me a Beer?
custom g or m codes with mach ???

I've created a functioning custom macro to use for the rotary axis , this is something that I've used on professional machines with great success . I have a macro sub routine that calculates xyz g52 work shifts for any new angle positions based on calculations from the center of rotation to the actual xyz zero positions of the part at A zero, which is to say that I only need to pick up one single work shift from the A axis zero point and the machine calculates the rest for any given angle of rotation , so it gives me a g52 shift for xyz , anyhow it appears that with a few mods it will work well with mach .
now to get to my question , is it possible in mach to create a custom g or m code , I'd rather edit in a simple g code than to add a sub routine call for every rotation , point is to minimize the amount of editing that i need to do to the program and to build the routine into mach rather than it always be at the bottom of the program
this way my program will look like this before the rotation

#1=45.(rotation variable)
g555(*********custom g code with the calculations)
g52x#2y#3z#4
g0 a#1
x***y***

rather than it looking like this

#1= 90.
m98 P8989 (does the calculations in the sub routine which is at the bottom of the program)
G52 X#2 Y#3 Z#4
g0 a#1
x***y***

its always necessary to have the variables in the program header but it would be nice to hide the calculations in the custom g or m code




.
__________________
A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org
Reply With Quote

  #2   Ban this user!
Old 09-12-2011, 01:29 PM
hub hub is offline
 
Join Date: Sep 2010
Location: Finland
Posts: 435
hub is on a distinguished road

I don't know for sure, but I would say no. It's not possible to add a custom g or m code. I think they are hard coded into the software. 99.99%sure..
__________________
http://www.cnczone.com/forums/cnc_wood_router_project_log/125895-my_diy_cnc_cnc2011_%3B.html
Reply With Quote

  #3  
Old 09-12-2011, 03:17 PM
dertsap's Avatar
Gold Member
 
Join Date: Oct 2005
Location: canada
Posts: 3,668
dertsap is on a distinguished road
Buy me a Beer?

i kinda figured so , I cant find any info on it , so if its not possible then its a bit of an inconvenience but not the end of the world , it would be a nice option to have
__________________
A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org
Reply With Quote

  #4  
Old 09-12-2011, 03:34 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,542
Al_The_Man is on a distinguished road
Buy me a Beer?

Mach describes 'Customizable M codes through VB script'.
M codes are usually for external control (PLC like) feature.
But I get the impression that Mach does not use a FIN signal feature, IOW wait until a M code complete signal if needed.
I have not done that much with Mach so I could be wrong.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #5  
Old 09-12-2011, 04:31 PM
dertsap's Avatar
Gold Member
 
Join Date: Oct 2005
Location: canada
Posts: 3,668
dertsap is on a distinguished road
Buy me a Beer?

i agree that m codes are normally used for external control but hope that i can make something work , this tends to be more for my twisted curiosity and convenience than necessity .
I've played a bit in the macro folder for mach 3 and it seems that i can take the code from the m3 macro , and create a new m code m9797 which runs the same code as the m3 and it works , so hopefully with a bit more research I'll figure out how to (if i can) do my calculations within the m code , then have the calculated variables input into the local variables in mach .
its a nice day , I'm going fishing so it will go on the back burner
__________________
A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org
Reply With Quote

Sponsored Links
  #6  
Old 09-13-2011, 12:27 AM
dertsap's Avatar
Gold Member
 
Join Date: Oct 2005
Location: canada
Posts: 3,668
dertsap is on a distinguished road
Buy me a Beer?

got it , its simply a matter of putting SetVar(1, 9.) into the new M9797.M1S file that i created in the macro folder
1 is the variable to modify and 9 is the value to set
so now as a test with an m9797 before g0g90 x#1 , then x will travel 9"
so with it being able to do that then what i want to do will be pretty much a breeze .
__________________
A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org

Last edited by dertsap; 09-13-2011 at 12:45 AM.
Reply With Quote

  #7  
Old 11-13-2011, 01:19 AM
dertsap's Avatar
Gold Member
 
Join Date: Oct 2005
Location: canada
Posts: 3,668
dertsap is on a distinguished road
Buy me a Beer?

ok so the basics of this macro is coming together , the calculations are done but need to be modified some for mach to understand what i'm telling it to do , I'm trying to minimize the amount of code that i need to edit into my programs so the g52 shift will be within the custom m code , this way I'll only need to edit in the m code after every rotation , A axis rotations will no longer need to be a variable number in the program as i had it before because i can get the dro value within the macro after the A axis rotation (if if any of this makes sense to anyone) , now for the trouble that I'm having in order to complete this task , i need to edit the m1 and m30 so that i can cancel the g52 shift by adding g52x0y0z0 .
where is the coding for the m30 and m1 , these m codes are not in the macro folder and i can't seem to find them anywhere ? is it possible to modify these two m codes ?

so far the custom header will look similar to this


%
O8000
#1= 1.025 (Y DEV from center of rotation at A0)
#2= -0.529 (ZDEV from center of rotation at A0)
#3= 0 (ANGLE )
#4= -2.525 (SHIFT FROM TOOLPROBE T0 part Z0 AT A0)

g0g90 x blah y whatever A0
m9797
g43 blah
blah
a90.
m9797(custom m code after rotation which trigs g52 shift based from g54 position and all variables)
g0x@$y^@
;
;
;
.
__________________
A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org

Last edited by dertsap; 11-13-2011 at 01:41 AM.
Reply With Quote

  #8  
Old 11-13-2011, 07:28 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,458
ger21 is on a distinguished road
Buy me a Beer?

No, those two are hard coded.

What I'd do is make two custom M codes and have them tag along with M1 and M30, say M901 and M930.

Have your post put them in your code something like this.

M1
M901
....
....
....
....
M930
M30

So, after your M1 stop, the M901 can do what you want to do with M1.

Then at the end of your code, the M930 can do what you need before the M30 rewinds to the beginning.

I missed this thread earlier. let me know if you get stuck, and I'll try to help if I can.
__________________
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

  #9  
Old 11-13-2011, 12:53 PM
dertsap's Avatar
Gold Member
 
Join Date: Oct 2005
Location: canada
Posts: 3,668
dertsap is on a distinguished road
Buy me a Beer?

thanks Ger
That's what I sort of figured I'd have to do , what I think I'll do is create a couple m codes to replace the m1 and m30 ,
this way a couple of simple program edits will suffice and I should be able to modify my post to do it for me .
So far I've got all the basics down and will finish it at some point soon , right now much of my focus is on completing my mill conversion , and today getting some fish smoked
__________________
A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dyna 4M macros and custom G codes dave design Dyna Mechtronics 1 10-28-2010 08:46 PM
Manual Guide i macros (custom g-codes) on Fanuc 18i-MB disabling/params? gwarble Fanuc 2 04-06-2010 08:46 PM
[18i-MB] not allowing custom g-codes over 100 (or 3 digits) gwarble Fanuc 5 03-22-2010 09:13 AM
help using custom M codes and M-FIN on haas josh591 Haas Mills 6 09-30-2008 12:14 PM
Custom G codes in Custom G codes stevo1 Fanuc 7 09-09-2008 02:32 PM




All times are GMT -5. The time now is 05:49 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