Need Help! macro help


Results 1 to 6 of 6

Thread: macro help

  1. #1
    Registered
    Join Date
    Apr 2014
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default macro help

    hi I decided to learn macro programming and I had a few ideas that I wanted to try. the machine I work with is a Mitsubishi meldas 300 it supports macros and has a page for common variables and local variables. The machine does not have cutter comp so im trying to make my own cutter comp program . here is the program, the alarm I get is p240 no variable. spec


    O1000 (ANY OUTSIDE ARC WITH TOOL COMP)
    #1=.5 (RADIUS OF CUTTER)
    #2=1 (HEIGHT OFFSET)
    #3=.1 (ZDEPTH)
    #4=1. (RADIUS OF ARC)
    #5=20. (FEED)
    #6=1000 (RPM)
    #7=54 (FIXTURE OFFSET)
    #8=.5 (LEAD IN/OUT)

    G00 G90 G[#7] X-[#4+#1+#8] Y0
    S[#6]M03
    G43 H[#2] Z.1
    G01 Z-[#3] F[#5]
    Y-[#8]
    G03 X-[#4+#1] Y0. I0. J[#8]
    G02 X[#4+#1] Y0. I[#4+#1]J0.
    G02 X-[#4+#1] Y0. I-[#4+#1]J0.
    G03 X-[#4+#1+#8] Y[#8] I-[#8] J0.
    G01 Y0.
    G00 Z1.
    M30

    Similar Threads:


  2. #2
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default Re: macro help

    Quote Originally Posted by jbarnekow View Post
    hi I decided to learn macro programming and I had a few ideas that I wanted to try. the machine I work with is a Mitsubishi meldas 300 it supports macros and has a page for common variables and local variables. The machine does not have cutter comp so im trying to make my own cutter comp program . here is the program, the alarm I get is p240 no variable. spec


    O1000 (ANY OUTSIDE ARC WITH TOOL COMP)
    #1=.5 (RADIUS OF CUTTER)
    #2=1 (HEIGHT OFFSET)
    #3=.1 (ZDEPTH)
    #4=1. (RADIUS OF ARC)
    #5=20. (FEED)
    #6=1000 (RPM)
    #7=54 (FIXTURE OFFSET)
    #8=.5 (LEAD IN/OUT)

    G00 G90 G[#7] X-[#4+#1+#8] Y0
    S[#6]M03
    G43 H[#2] Z.1
    G01 Z-[#3] F[#5]
    Y-[#8]
    G03 X-[#4+#1] Y0. I0. J[#8]
    G02 X[#4+#1] Y0. I[#4+#1]J0.
    G02 X-[#4+#1] Y0. I-[#4+#1]J0.
    G03 X-[#4+#1+#8] Y[#8] I-[#8] J0.
    G01 Y0.
    G00 Z1.
    M30
    Execute the program in Single Block Mode to identify the Block in which the error first occurs and advise the Forum members. Macro Statement Block that occur consecutively will execute as one Block in Single Block Mode unless a parameter is set. However, all of the Blocks in your listed program are NC Block; accordingly, you should have no difficulty in executing each Block in Single Block Mode.

    Although Cutter Radius Comp is an Option, its rather rare for a machine not to be supplied with this Option. It would be a very Bare Bones controller and likely not to have the User Macro Option if it doesn't have Cutter Radius Comp. How did you determine that the control doesn't have Cutter Radius Comp.

    Regards,

    Bill



  3. #3
    Registered
    Join Date
    Apr 2014
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default Re: macro help

    well lets put it like this, if it has it is broke. there is no place to put a diameter or radius value, there is a tool offset page but whatever you enter transfers over to the tool length screen, meaning if I input .5 in offset #1 my tool length for tool 1 will change to .5 as well. I have tried lying to it such as giving it a d10 or whatever and then calling up tool comp doesn't work. im only assuming that it has macros because of the common and local variables screens. I think that my error is cause I am trying to run the macro program as a main program, I think I need a g65 line in a separate program to call the macro, I will try that tomarrow. I just assumed that the program would read #1=.5 and automatically store .5 in #1, i guess that's what the g65 is for.



  4. #4
    Registered
    Join Date
    Apr 2014
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default Re: macro help

    I re-wrote the program and will try this tomarow hopefully it works.

    O1000
    G00 G90 G54 X0 Y0
    G65 P1001 A.5 B1 C-.1 I1. J100. K1000 E.5
    G00 Z5.
    M30
    %
    O1001 (ANY OUTSIDE ARC WITH TOOL COMP)
    (#1=A (RADIUS OF CUTTER))
    (#2=B (HEIGHT OFFSET))
    (#3=C (ZDEPTH))
    (#4=I (RADIUS OF ARC))
    (#5=J (FEED))
    (#6=K (RPM))
    (#8=E (LEAD IN/OUT))

    G00 G90 X-[#4+#1+#8] Y0
    S[#6]M03
    G43 H[#2] Z.1
    G01 Z[#3] F[#5]
    Y-[#8]
    G03 X-[#4+#1] Y0. I0. J[#8]
    G02 X[#4+#1] Y0. I[#4+#1]J0.
    G02 X-[#4+#1] Y0. I-[#4+#1]J0.
    G03 X-[#4+#1+#8] Y[#8] I-[#8] J0.
    G01 Y0.
    G00 Z1.
    M99



  5. #5
    Member
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    1230
    Downloads
    0
    Uploads
    0

    Default Re: macro help

    Quote Originally Posted by jbarnekow View Post
    I re-wrote the program and will try this tomarow hopefully it works.

    O1000
    G00 G90 G54 X0 Y0
    G65 P1001 A.5 B1 C-.1 I1. J100. K1000 E.5
    G00 Z5.
    M30
    %
    O1001 (ANY OUTSIDE ARC WITH TOOL COMP)
    (#1=A (RADIUS OF CUTTER))
    (#2=B (HEIGHT OFFSET))
    (#3=C (ZDEPTH))
    (#4=I (RADIUS OF ARC))
    (#5=J (FEED))
    (#6=K (RPM))
    (#8=E (LEAD IN/OUT))

    G00 G90 X-[#4+#1+#8] Y0
    S[#6]M03
    G43 H[#2] Z.1
    G01 Z[#3] F[#5]
    Y-[#8]
    G03 X-[#4+#1] Y0. I0. J[#8]
    G02 X[#4+#1] Y0. I[#4+#1]J0.
    G02 X-[#4+#1] Y0. I-[#4+#1]J0.
    G03 X-[#4+#1+#8] Y[#8] I-[#8] J0.
    G01 Y0.
    G00 Z1.
    M99
    A program with Macro Variable assignments and Macro Statements can be run as a Main Program, there is no requirement to call the program with G65 or G66.

    The above method will most likely work, as you're explicitly passing the values via the G65 call. However, there is no reason, under normal circumstances, for assigning values to Local Variables in the program not to work.

    Just a small point on form. When using a Macro Call Block (G65, G66, Custom G or M Code) its better form to use more relevant address characters to pass the arguments. For example "F" and "S" for passing Feed Rate and Spindle Speed respectively.

    D = Cutter Radius (#7)
    H = Tool Length Offset (#11)
    Z = Z Depth (#26)
    R = Radius of Arc (#18)
    F = Feed Rate (#9)
    S = Spindle Speed (#19)
    etc.

    It makes understanding the Call Block easier.

    With regards to your Cutter Radius Offset issue, the Offset System is available in different forms. You can have:
    1. where Geometry and Wear is applied using the one Offset and no dedicated entry under the same number for Tool Radius.

    2. where Geometry and Wear are applied with the one Offset but with an entry for Geometry and Wear, but still with no dedicated entry under the same number for Tool Radius.

    3. where there are dedicated entries for Tool Length and Tool Radius under the same Offset number.

    The system the machine has depends on the Option supplied with the machine and is set via parameter. If at any time you were able to enter Tool Length and Tool Radius under the same Offset number, but now you can't, there may have been a time when the parameters were lost and not reinstated fully. With a control that has an Offset System that doesn't have a dedicated entry for Toll Radius, and there are many in this category, it is normal practice to use the same number Offset as the Tool Number for the Tool Length (H address) and an Offset Number that was way beyond the maximum capacity of the tool magazine to use for the Tool Radius Comp Offset.

    Because you should still have some numerical relationship between the Tool Number and the Tool Radius Comp number, you might select a constant of, say, 50 to add to the Tool Number being used to determine the Tool Radius Comp Offset to use. For example, with a machine that has a magazine capacity of 24 tools, Offset 1 to 24 are reserved for Tool Length Offsets and then add 50 to the Tool Number to determine the Tool Radius Offset Number. For Tool Number 1, Offset 1 would be used for Tool Length and Offset 51 for the Tool Radius Comp Offset. For Tool Number 2 it would be Offset 2 and 52 respectively for Tool Length and Tool Radius Comp.

    The application of the Tool Length and Tool Radius Offset would work something like the following.

    -----------
    -----------
    T01 M06
    S2500 M03
    G90 G00 X0.0 Y0.0
    G43 H01 Z0.1
    G01 Z-0.250 F_ _
    G41 G01 X_ _ D51
    ---------------
    ---------------
    ---------------
    ---------------
    G40 G01 Y0.
    G00 Z1.
    ---------------
    ---------------

    Regards,

    Bill

    Last edited by angelw; 04-23-2014 at 11:25 PM.


  6. #6
    Registered
    Join Date
    Apr 2014
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default Re: macro help

    hi again, thanks for all your advise, I tried the cutter comp thing again with your format and it worked, I was putting the D value in my g43 line calling both the height and diameter of the tool at the same time, as for the macros I am still having troubles. if I go into mdi and type in #1=5. and hit cycle start while in single block mode I get an error P240 no variable spec. if I type in g65x1.y1.z1.d1.f1. I get an error P270 no hat macro spec. I know that I have macros cause canned cycles are written in macros as shown in my manuals, and I found that there are hidden parameter screens which I activated and one of the screens says macros and gives options for how many g m s t codes can be set as macros. so the manuals say I have macros and the control has screens that support macros and I have a common variable screen and a local variable screen, I can manually put numbers into the common variables but not the local. another question I have is I have whats called automatic programming on this machine its called M-NAP and when I press the M-NAP button nothing happens, whats supposed to happen is a screen should pop up that allows me to conversationally program my parts, at least that's what my manuals say. how do I get it to work? again my machine is a Mitsubishi M-V60 MELDAS 300 SERIES



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

macro help

macro help