587,028 active members*
3,141 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2008
    Posts
    132

    Update and Macro Help request

    I am making progress transitioning from Mach3 to the UCCNC application using the UC300-5LPT. Built a couple of boards to galvanically (opti-isolate) the UC300-5LPT board from my switch pendant, home/limit swtiches and the VFD. The step and direction are isolated by the Gecko 203V stepper drivers. Hope to try it out on the Iron later this week.

    Presently working on the manual Tool Change and the pendant macros. I have them working fairly well but still need to work out some kinks.

    The most pressing problem is with the Tool Change macro. The simple macro turns the spindle off, saves the current X and Y coordinates, raises the Z to the home position and posts a MessageBox to the operator indicating " Change tool to TXX, touch off and set the Z to zero, Cycle Start to Continue. The initial problem was the MessageBox loosing focus and going behind the application pain when you tried to jog. Got this fixed so remained the top window. Thought I had it fixed but a G-Code test with three tool changes failed on change 2 and 3 where the MessageBox again went behind the applicaiton. I am an extremely novice at C# so I could use some help. I searched a lot, tried a lot of things but I just can't get the dam MessageBox to stay as the top window for subsequent Tool changes. The ares of interest is line 48 to 54 in the attached M6 macro file.

    The second isssue is how to call one macro from another. It's supposed to be possible but I can't get it to work.

    Here is a photo of my two interface boards, the left board attached to the pendant via the ribbon and 25pinD cable, the white 4 pin connectors attach to the Gecko 203V stepper drivers. The right board interfaces the limit switches, through the ribbon and terminal paddle board. The board also has a 6 pin connector to attach the VFD and provides a PWM to 0-10V converter with CCW and CW outputs.

    I really want to thank Balazs for all his help getting me this far, the response has been great.

    Attachment 308108

    Craig

  2. #2
    Join Date
    Dec 2010
    Posts
    634

    Re: Update and Macro Help request

    I wrote a simple M6 macro that automatically measures the tool length using a fixed plate on your machine. More info about the Macro can be found here: http://www.cnczone.com/forums/uccnc-...o-sharing.html

    Every now and then the window goes behind the main window but it's quite rare. Pressing return has the same effect as clicking ok in the box. I'd say that the window opened behind the main window maybe 2 or 3 times out of hundreds and hundreds of tool changes.

    I'd like to add a couple choices to the dialogue windows but haven't gotten around to it yet.
    -Andy B.
    http://www.birkonium.com CNC for Luthiers and Industry http://banduramaker.blogspot.com

  3. #3
    Join Date
    Oct 2005
    Posts
    1145

    Re: Update and Macro Help request

    Simple don't use a message box Send your messages to a message bar instead. That way you are never troubled by having to maintain focus.

    Just a thought, (;-) TP

  4. #4
    Join Date
    May 2008
    Posts
    132

    Re: Update and Macro Help request

    vmax549,
    That is exactly what I would like to do, the MessageBox.Show seems very buggy, I could not find any documentation on how to write to the message bar. Can give me the particulars on how to do that. i got an email into Balazs but not received a reply yet.

    Thanks,
    Craig

  5. #5
    Join Date
    Oct 2005
    Posts
    1145

    Re: Update and Macro Help request

    I use this to write to the bottom message bar on the main screen

    AS3.Setfieldtext("The machine moved to TOOL CHANGE location",900);

  6. #6
    Join Date
    May 2008
    Posts
    132

    Re: Update and Macro Help request

    Woohoo!!! That works for me. In the documentation I have, 900 is called the Profile_name so I didn't think to try and use it. Was thinking more about the scrolling window just above it. Do you know the field number for the scrolling window? In any case this will work great. One more problem solved.

    Still need M00 support, a jog step size of .0001, G98 support and some way to call a macro when the Spindle speed S-word appears in the G-Code or MDI.

    Thanks,
    Craig

  7. #7
    Join Date
    Oct 2005
    Posts
    1145

    Re: Update and Macro Help request

    OK Just curious why would you need to know if teh Sword is in teh Gcode ? Nothing in a macro will allow you to parse teh Gcode file or teh MDI.

    (;-) TP

  8. #8
    Join Date
    May 2008
    Posts
    132

    Re: Update and Macro Help request

    I would like to have the ability to look at the S-word in the G-Code or being entered via the MDI so I can change the maximun and minimum Spindle RPM values for the PWM. I have a step pulley system with different ratios. An S1200 would have different PWM values in pulley setp 3 and pulley step 4. Currently I did a series of macros M2601 through M2604 that allow me to change the max/min value for the 4 pulley ratios. If I could see the S-word then I could switch the max/min values based on the Svalue finally passing the Svalue on to the core engine. Mach3 had pulley ratio processing capability which is not in UCCNC. I also did a macro for back gear that provides a different set of max/min values and causes the M3 and M4 to swap rotation. If Balazs puts in spindle processing I will not need this.

    This morning I received a reply form him on a number of questions. Will do another post later have to run now. Two items: To write to the scrolling window just below the run from hear field use: exec.AddStatusmessage("This is my message"); He also indicated they are working on an Ethernet version of the UC300.

    Craig

  9. #9
    Join Date
    Oct 2005
    Posts
    1145

    Re: Update and Macro Help request

    OK you can SEE teh Sword from the DRO value does that help ?

  10. #10
    Join Date
    May 2008
    Posts
    132

    Re: Update and Macro Help request

    Could probably make that work it there was a way to trigger the macro when the value changed, however the PWM value would have already been calculated by then. However, I think it may be possible to redo the calculations again in the macro overriding the previous value, assuming the machine doesn't start moving while in the macro. I don't intend to change the RPM value in the Sset field just make sure the PWM value is correctly calculated for the pulley rpm range.

    What 's really needed is a way to to trigger a macro when the Sword is seen in the G-Code or in the MDI before it is presented to the engine. The RPM value would be used in the macro to calculate the proper pulley position, notify the operator if the machine was not already on that range. Then it would set the Max and Min RPM values for the selected pulley range into the Spindle Configuration's Min and Max spindle velocity fields. Finally it would pass the RPM value to the engine and the process would continue as it does today and the PWM would be scaled accordingly. The operator could decline to change the pulley ratio, in which case the Svalue passed to the engine and set in the Sset filed would be the current Minimum or Maximum value for that pulley depending if the G-code Sword was above or below the range. For a two speed motor where one could use a relay to change the speed the macro could set the appropriate IO bit to do that.

    The macro could also be used to control an auxiliary spindle by examining the Svalue. ie S15000 is not a value of the current pulley set so it must be for the aux spindle, it could set a flag variable so the next M3 or M4 would run the aux spindle rather than the main spindle. I can see lots of possibilities.

    Craig

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2012, 01:28 PM
  2. Replies: 3
    Last Post: 02-13-2012, 07:20 PM
  3. Macro sample request
    By leggazoid in forum Fanuc
    Replies: 0
    Last Post: 10-26-2009, 04:39 PM
  4. Replies: 2
    Last Post: 03-27-2009, 09:15 PM
  5. Convert Fanuc Macro to Fadal Macro
    By bfoster59 in forum Fadal
    Replies: 1
    Last Post: 11-09-2007, 06:41 AM

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
  •