UCCNC Macro sharing - Page 2

Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 66

Thread: UCCNC Macro sharing

  1. #21
    Registered
    Join Date
    Jun 2014
    Posts
    777
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Quote Originally Posted by BanduraMaker View Post
    I thought I'd start a thread where we can share our macros. I'll start by sharing the macros I made.

    USE AT YOUR OWN RISK!!!!

    First combo are M31 and M6 for auto tool length measuring after a manual tool change. When running a part, you use a mobile Z-touch plate and a fixed touch plate. M31 will probe down at the current location, then retract and move over to the fixed plate and probe. It then calculates the difference between Zzero and the fixed plate and stores that value in the C-axis DRO for later use by the M6 macro. Z-zero is set to the same value for offsets G54 to G59.

    The M31 macro also supports a "material offset" which can add or subtract an amount from Z zero. If this is non-zero when you call the macro, a message box will come up to remind you that it is non-zero.

    The M6 macro stops the spindle and then moves to a tool change location. Once you're done changing tools, hit return or click ok and the machine will move to the fixed plate, probe down and set a new Z-zero for all offsets.

    You must customize the macro by entering the coordinates of your tool change position, fixed plate position, Z-setting plate thickness etc. etc.

    Remember, USE AT YOUR OWN RISK!!!!

    I'd ask that if you make any improvements or modifications that you please post back to this thread so that everyone can benefit.
    Hi Andy.

    Im interesting in trying out your macro, I have a question however, I know you posted a long time ago so i hope your still familiar with this one. Im using bottom of stock as z zero and my probe plate is around 19mm but as you mentioned the m31 supports material offset so no problem there. so i would sit my probe plate on my 18mm spoil board and the spoil board is sat on the machine bed. (little machine i have dedicated to cutting foam but z is very tight as is so deeper spoil board not possible unfortunately). However my fixed probe plate is also 19mm so sits 1mm higher than z zero. will the m31 still be effective working in the positive and not the negative of z zero.

    Thanks
    Jon



  2. #22
    Member BanduraMaker's Avatar
    Join Date
    Dec 2010
    Location
    USA
    Posts
    634
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Hi Jon,

    If I remember correctly, the macro should work even with the fixed plate lower than Z-zero. What the macro does is store the difference between Z0 and the fixed plate in the axis C DRO. When probing with an M6, it stops the tool when it trips against the fixed plate and assigns that value to the Z-DRO. Should work.

    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com


  3. #23
    Registered
    Join Date
    Jun 2014
    Posts
    777
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Quote Originally Posted by BanduraMaker View Post
    Hi Jon,

    If I remember correctly, the macro should work even with the fixed plate lower than Z-zero. What the macro does is store the difference between Z0 and the fixed plate in the axis C DRO. When probing with an M6, it stops the tool when it trips against the fixed plate and assigns that value to the Z-DRO. Should work.
    Good news, I haven't got around to trying it yet but as soon as i have i will post up the outcome. Thank You!



  4. #24
    Registered
    Join Date
    Jun 2014
    Posts
    777
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Quote Originally Posted by BanduraMaker View Post
    This Macro is a simple Z-zero probe. Machine probes down and sets z-zero for all offsets. I named it M200 and it can be accessed by pressing the P1 button and the default screen.
    Hi andy, i thought id start by trying the m200 macro. My z travel down is negative, however without modification the m200 macro is sending the z upwards on first move. Cant figure out why.

    Corrected: I was over writting the default macro but not in the profile folder lol.

    I got it running but im getting an odd behavior, It probes down to the plate and it stops around 0.5mm off the plate and then starts flicking between very small up and down motions repeatedly except the dro's continue to drop at coarse feed rate (no up moves are registering in dro). I tried starting with lower z values well within maxium z probe distance. same result, i also monitored diagnostics tabs and at no time does the probe or input pin led light activate. Manually shorting circuit it works fine.

    any ideas?

    Cheers

    Update: If i lift the z and run macro, then instead of having clip on the bit short on the plate, it runs perfectly. So its receiving a skip signal before it actually touches the plate and uccnc stops plunge, retracts by a half a mm or so then continues probe, seems like the skip signal is not large enough to register in uccnc so dros continue to drop but the uc400 registers it and is acting on it??. Just tried putting a resistor in series, no effect.

    Last edited by Jon.N.CNC; 06-08-2016 at 07:45 PM.


  5. #25
    Member
    Join Date
    Apr 2014
    Posts
    215
    Downloads
    27
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Part / Material Test Fit Macro, ported from Mach3

    (Note... new to uccnc, seems to work fine on my machine, usual disclaimers apply).

    Thought I'd have a go at trying to progress uccnc & the community + learn c# a little with respect to uccnc (hence the comments... ) , give a man a fish, eat for a day, teach him how to fish & he'll sit & drink beer all day by the side of the river

    Rob

    edit: added a beep at each of the extent points (you can comment it out if it annoys you)

    Code:
    /*  M1020
        Part Extents Macro to test material fit
    
        ported from Mach3 to C# for uccnc, thanks to BR549/Vmax549/TP for the original macro
        25/06/2016 - robertspark
    
        NOTE: Set your feedrate and Dwell Time according to you machine parameters / units / requirements.
    */
    
    double FR = 1000; // sets Feedrate
    double DT = 3000; // Sets Dwell Time (mSec, 3000 = 3 sec)
    
    string XMax = AS3.Getfield(888); // 888  Diagnostics_maxX
    string XMin = AS3.Getfield(885); // 885  Diagnostics_minX
    string YMax = AS3.Getfield(889); // 889  Diagnostics_maxY
    string YMin = AS3.Getfield(886); // 886  Diagnostics_minY
    
            DialogResult result;
    
            result = MessageBox.Show("Is Your Z HEIGHT Safe To Travel?", "check!!!" , MessageBoxButtons.YesNo);
            
           if (result == System.Windows.Forms.DialogResult.Yes)
            {
    
                exec.Code("G92 X0 Y0 Z0"); // Zero the DRO's
                exec.Code("G01 X" + XMin + " Y" + YMin + " F" + FR); // Move to Minimum X & Y Coordinates
                while(exec.IsMoving()){}
                exec.Wait(200);
                Console.Beep();
                
                exec.Code("G04 P" + DT);
                exec.Code("G01 Y" + YMax); // Move to Maximum Y Coordinates
                while(exec.IsMoving()){}
                exec.Wait(200);
                Console.Beep();
                
                exec.Code("G04 P" + DT);
                exec.Code("G01 X" + XMax); // Move to Maximum X Coordinates
                while(exec.IsMoving()){}
                exec.Wait(200);
                Console.Beep();
                
                exec.Code("G04 P" + DT);
                exec.Code("G01 Y" + YMin); // Move to Minimum Y Coordinates
                while(exec.IsMoving()){}
                exec.Wait(200);
                Console.Beep();
                
                exec.Code("G04 P" + DT);
                exec.Code("G01 X" + XMin); // Move to Minimum X Coordinates
                while(exec.IsMoving()){}
                exec.Wait(200);
                Console.Beep();
                
                exec.Code("G04 P" + DT);
                exec.Code("G01 X0 Y0"); // Move to 0,0 X & Y Coordinates
                while(exec.IsMoving()){}
                exec.Wait(200);
                Console.Beep();
                
            }
        
           if (result == System.Windows.Forms.DialogResult.No)
            {
    
                MessageBox.Show("Move Z To A Safe Position And Restart");
    
            }


    Attached Files Attached Files
    Last edited by robertspark; 06-25-2016 at 01:15 PM. Reason: added a beep to the homing routine


  6. #26
    Registered
    Join Date
    Nov 2006
    Location
    United Kingdom
    Posts
    40
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Seems to work fine on mine too..Thanks Robert.

    Mark


  7. #27
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: UCCNC Macro sharing

    EXCELLENT Robert , Job well done (;-) YOU are going to really LIKE the new additions to the Macro side functions.


    (;-) TP



  8. #28
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Robert DO you need the trick to be able to dry run the outside profile as well ?? The trick is to be able to JUMP TO a line in the Gcode FROM the macro (;-)

    Note : Well actually it is a 2 part trick. I use SheetCam to add in 2 lines of code to the file in order for it to work correctly. YOU could do that manually as it is ONLY 2 lines of Gcode to add to each file. Easy peasy if you did not use Scam.

    (;-) TP



  9. #29
    Member
    Join Date
    Apr 2014
    Posts
    215
    Downloads
    27
    Uploads
    0

    Default Re: UCCNC Macro sharing

    TP,

    Yes, the outside dry run sounds like an interesting one. I'm guessing you add in a marker so that you can tell the macro to jump to the marker, and run from there?

    I do use sheetcam (and a number of your plugins too (well they are loaded), can't thank you enough for the stuff I've learned), hence adding in the beep I thought may be a handy feature (as I didn't think sounds / button options were listed anywhere they may help someone else with ideas).

    At the moment there seems to be G68/G69 missing which would allow you to dry run the outer edge or extents and then rotate the part, I did send an email to Balazs to ask that it can be added to the wish list (Les at sheetcam has a good method of voting for wish list items, at least you can gauge interest & priority and not satisfying the few then [which Art may have done when M3 was getting started]).

    Manuals / example macros would be helpful too (I've used the 2 vb script / cypress manuals for M3 extensively, along with the DRO, buttons pdf manual).

    OT, is there a manual on the screen edit side, as I know where the button is, but can't seem to get back to the "run" screen to edit it

    Rob



  10. #30
    Member
    Join Date
    Jun 2015
    Location
    Sweden
    Posts
    943
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    OT, is there a manual on the screen edit side, as I know where the button is, but can't seem to get back to the "run" screen to edit it
    There is some basic explanation of the screen editor in the users manual.
    To change tab pages in screen edit mode press the shift key on the keyboard, keep it down and click the tab page.



  11. #31
    Member
    Join Date
    Apr 2014
    Posts
    215
    Downloads
    27
    Uploads
    0

    Default Re: UCCNC Macro sharing

    OlfCNC, thanks very much

    Rob



  12. #32
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Hi Robert. The create a jump to point From Scam you mod teh post to add this line after teh M3 AND teh TOM routine.

    You use teh Oword as used for a SUB

    o549.

    This is on a line all its own

    Also after teh M30 at teh end of the file add a line M99

    M30
    M99

    From Inside of teh macro you call

    // GOTO the Jump Point in Gcode;
    exec.Code( "M98 P2 ");
    exec.Callbutton(128);

    THIS is a one way Jump To the Oword. You cannot jump back (;-)

    (;-) TP



  13. #33
    Member
    Join Date
    Apr 2014
    Posts
    215
    Downloads
    27
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Terry, brilliant, thanks very much.

    Showing my inexperience now, but I'd never used M98/99 and "o" codes.... thanks again, I've learnt a lot new today.

    very easy macro & subroutine to use (I've fully reworked / created a sheetcam postprocessor, more as I wanted to understand the sequence of events than wasn't happy with the vast array possible, I wanted to add voltage and THC to my postprocessor so it would store the info in the tools and send it out directly to the THC similar to the CanCNC ones provided so have learnt a lot there (tip of the iceberg, but a tip is a start).

    Rob



  14. #34
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: UCCNC Macro sharing

    IF you want to update teh THC values based on TOOL# USE teh M6 macro to change tools but put in the code to update teh thc instead (;-) Then from there you can call other values into play based on teh tool# you chose. I was doing that LONG before CandCNC did it (;-) I simply used teh tool table values in Mach3 there are 5 you can use and maintain in MACH3.

    For NOW in UCcnc there is only 1 value. HOPEFULLY soon that will change and we can have a full tool table working.

    UCcnc is so much fun to work with (;-)

    (;-) TP



  15. #35
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: UCCNC Macro sharing

    NOW IF you want to bring in Scam values so you can use then in UCcnc bring them in as # vars

    Mod your post use Scam values to transfer to UCcnc when the Gcode runs.

    #1 =1.111
    #2= 2.222
    etc

    When the Gcode runs it transfers the values Scam posted to teh file TO UCcnc #var values. At that point you can use them in Gcode or Macros (;-) Iused that a lot to bring in Scam calculations into Mach3. Things such as Cut time, # pierces, etc. Anything you can find in Scam you can transfer this way to UCcnc.

    ALSO you may not have noticed NOW you can use teh M30 macro to run script at teh end of file in UCcnc When it sees teh M30 in Gcode it calls teh M30 macro. I use this to create a work log of everything that UCcnc runs (;-) I add teh file name date time anything I want to track and write it to teh WorkLog.

    WHAT ?????? you do not have a work log.

    I can also track dead time to see how long someone spends in between jobs (;-)

    You can track # pierces directly in UCcnc now.

    You cannot track CUT INCHES yet but you can track how long that cut takes and get teh IPM value from Uccnc and back teh cut inches out as a value. It is NOT exact but VERY close. Close enough to track consumables.

    OH yes I do track consumable (electrodes and nozzles) and it write teh report AND calculated teh cost per for each item . Teh report also gives you a running history of when you changed out a consumable and on what job and how far into teh job you were.

    THAT trick will ALSO allow you to track wear on Router Mill bitsbased on time or cut inches . BUT we do NOT have a real tool table at this time to store that info.

    Well we do have info storage you can always WRITE any data to teh UCcnc "INI : (pro) file. You can do that from a macro script READ and WRITE that way you can store values and it gets saved in UCcnc .AND you can retrieve it later when you need it (;-) AND it is always persistant.

    I can also at that point CALL my cell and send a TEXT message to ME if I am not going to be at teh machine that moment. That way I KNOW when the program is finished.

    SO MUCH FUN, not enough time in the day (;-)

    (;-) TP



  16. #36
    Registered MerzkeCustom's Avatar
    Join Date
    Jul 2016
    Location
    United States
    Posts
    10
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Looking for a little help! I have a 3 axis touch plate that I was using in Mach3 and now that I have switched to UCCNC I am trying to get it to work there. It came with an excel document that created some G-Code that you saved in Mach3 and by clicking the auto tool zero button it would run the macro. Is there a way of getting UCCNC to do the same function? I have the excel doc and can email it to anyone that might be able to help. Thanks in advance!



  17. #37
    Member
    Join Date
    Jun 2015
    Location
    Sweden
    Posts
    943
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Quote Originally Posted by MerzkeCustom View Post
    Looking for a little help! I have a 3 axis touch plate that I was using in Mach3 and now that I have switched to UCCNC I am trying to get it to work there. It came with an excel document that created some G-Code that you saved in Mach3 and by clicking the auto tool zero button it would run the macro. Is there a way of getting UCCNC to do the same function? I have the excel doc and can email it to anyone that might be able to help. Thanks in advance!
    You can probe with G31 in the UCCNC just like how you can in Mach3.
    There is the M31 macro button, the red probe iconic button on the main screen, pressing that calls the macro M31 in your Profile/macros folder, it actually do probing.
    Open that folder up and check the M31 code to see what it exactly does.



  18. #38
    Member
    Join Date
    Apr 2014
    Posts
    215
    Downloads
    27
    Uploads
    0

    Default

    I don't believe there is a macro function that will allow the values to be written to an external file (CSV or text)
    ....
    But I may be wrong
    Rob



  19. #39
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: UCCNC Macro sharing

    This will write a string to a file 1 line at a time. IF there is NO such file it creates it and IF there is a file it appends to it.

    // Write one string to a text file.
    string text = "X" +AS3.Getfield(226) + " , Y" + AS3.Getfield(227) + " , Z" + AS3.Getfield(228);
    System.IO.File.AppendAllText(@"C:\uccnc\Probe1.txt ", text+ Environment.NewLine);

    THIS is what the file looks like after 3 probes and writes

    X0.2000 , Y1.9500 , Z-0.6700
    X0.8100 , Y2.7550 , Z-0.1950
    X1.7450 , Y2.4950 , Z-1.2800

    Hope that helps , (;-) TP



  20. #40
    Registered
    Join Date
    Jul 2015
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: UCCNC Macro sharing

    Hello everyone!...
    I have a question, im writing a macro that need the user input a value into a variable. Anyone know how can achieve it???

    Thanks in advance!!



Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

UCCNC Macro sharing

UCCNC Macro sharing