![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Mach Software (ArtSoft software) Discuss Mach 1 , 2 and the new Mach3 here NC software here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
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 |
|
#2
| |||
| |||
| 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 |
|
#3
| ||||
| ||||
| 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 |
|
#4
| ||||
| ||||
| 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. |
|
#5
| ||||
| ||||
| 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 |
| Sponsored Links |
|
#6
| ||||
| ||||
| 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. |
|
#7
| ||||
| ||||
| 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. |
|
#8
| ||||
| ||||
| 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) |
|
#9
| ||||
| ||||
| 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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |