586,119 active members*
3,490 visitors online*
Register for free
Login
Results 1 to 18 of 18
  1. #1
    Join Date
    Sep 2017
    Posts
    15

    31i macro argument issues

    Hey everyone,
    I have been writing macro and complex macro programming, and have come into a issue with our Tsugami SS-32 with 31i control. This is a quick through together test that has failed and I can not understand why.
    If I put 42 or 0042 in #120 the process works but when I try to put 334 or 0334 in #120 it does not work and I don't know why. Is there a parameter that is blocking any thing more than 2 digits in the argument? I just cant find the problem if there is 1.


    O9510(TEST ARGUMENT)

    #120=42

    IF[#120EQ0042]THEN#142=12.5
    IF[#142GT0]GOTO300
    IF[#120EQ0046]THEN#142=15
    IF[#142GT0]GOTO300
    IF[#120EQ0357]THEN#142=0
    IF[#142EQ0]GOTO200
    IF[#120EQ0037]THEN#142=7.5
    IF[#142GT0]GOTO300
    IF[#120EQ0334]THEN#142=2.5
    IF[#142GT0]GOTO300
    IF[#120EQ0351]THEN#142=2.5
    IF[#142GT0]GOTO300
    IF[#120EQ0204]THEN#142=2.5
    IF[#142GT0]GOTO300



    N200

    M00

    GOTO3

    N300

    M00

    N3

    #120=0
    #142=0

    M30

    Thanks,

  2. #2
    Join Date
    Feb 2006
    Posts
    1792

    Re: 31i macro argument issues

    The problem is not with assignment. There is some error in your logic. What exactly you want to do and what error message do you get?

  3. #3
    Join Date
    Sep 2017
    Posts
    15

    Re: 31i macro argument issues

    The funny thing is that I am not getting any error messages. When I when to the 3rd digit on my #120 call the system just went to a default zero call in the #142. I don't understand why this happened. I am testing to make macro programming for different family of parts out of different bar lengths. I am wanting to use a 4 digit call out in macro, to call the programming to run a macro programming system. Basically to put the part number in and it runs the part, giving the operators no chance to screw something up and no chance for them to alter the programs as they think. I have it all written, but I was testing a simple call.

  4. #4
    Join Date
    Feb 2006
    Posts
    1792

    Re: 31i macro argument issues

    If you do not define #142, it remains #0 which is equivalent to 0 except in EQ and NE comparison

  5. #5
    Join Date
    Sep 2017
    Posts
    15

    Re: 31i macro argument issues

    With out going to far in depth of my process. I really wanted help to understand why its defaulting #142 to zero when I get to #120=334 or #120=357 or #120=204. Like I said this is a very basic sample. This is not the actual programs that need to work.
    Wait a minute.... IF[#120EQ334]THEN#142=2.5; is defining #142. What are you saying????

  6. #6
    Join Date
    Jul 2010
    Posts
    118

    Re: 31i macro argument issues

    the concept you want to use do work, i applied this method regularly.

    up to a 9 digit number would work, no limitations, leading zero's does nothing.

    as you did not post your original program, i can't tell, but would suggest you look for a typo error then.
    you do not need to pre-define #142 in a Fanuc control, just do the check correctly.

    to get constructive help, pls post the actual part of your program.

    have fun

  7. #7
    Join Date
    Feb 2013
    Posts
    21

    Re: 31i macro argument issues

    At the beginning try adding #142=#0 after your #120 to clear out any number that might be in #142

    O9510(TEST ARGUMENT)

    #120=42

    #142=#0

    IF[#120EQ0042]THEN#142=12.5
    IF[#142GT0]GOTO300
    IF[#120EQ0046]THEN#142=15
    IF[#142GT0]GOTO300
    IF[#120EQ0357]THEN#142=0
    IF[#142EQ0]GOTO200
    IF[#120EQ0037]THEN#142=7.5
    IF[#142GT0]GOTO300
    IF[#120EQ0334]THEN#142=2.5
    IF[#142GT0]GOTO300
    IF[#120EQ0351]THEN#142=2.5
    IF[#142GT0]GOTO300
    IF[#120EQ0204]THEN#142=2.5
    IF[#142GT0]GOTO300

    N200

    M00

    GOTO3

    N300

    M00

    N3

    #120=0
    #142=#0

    M30

  8. #8
    Join Date
    Feb 2006
    Posts
    1792

    Re: 31i macro argument issues

    Quote Originally Posted by Azmodi View Post
    With out going to far in depth of my process. I really wanted help to understand why its defaulting #142 to zero when I get to #120=334 or #120=357 or #120=204. Like I said this is a very basic sample. This is not the actual programs that need to work.
    Wait a minute.... IF[#120EQ334]THEN#142=2.5; is defining #142. What are you saying????
    With this statement, if #120 stores 334, then #142 will now store 2.5; otherwise, #142 would remain unchanged (would remain null if previously undefined)
    A null variable is equivalent to 0 except in a few cases.

  9. #9
    Join Date
    Feb 2013
    Posts
    21

    Re: 31i macro argument issues

    sinha,

    0 is a number. It is not null. #0 will make it null.

  10. #10
    Join Date
    Sep 2017
    Posts
    15

    Re: 31i macro argument issues

    We are using a Iemca Boss 332E barfeeder. The bar lengths are 120", 144", and 240". The min remnant length is 9". So we have to calculate how much of the material has to come off the bar so that it will drop at bar change. I have the machine do all the math cause it is easier that way. Here is the actual program that I am using and the issue is still the same.

    The #120 is part length
    The #142 is the amount of pre-cutoff of the bar.

    %
    O9500(10' BAR CHANGE)

    #100=[111/[#120+.125]] explanation: 120-9/ (part length + .125) (remember 9 is min remnant and .125 is cut off width)
    #101=FIX[#100]
    #102=[#100-#101]
    #103=[#102*[#120+.125]]
    #104=[#103+9] adding the min remnant back

    IF[#104EQ9.525THEN#142=7.5 (This scenario does not work, the part length is 10.85". The machine will not self input the amount in #142. goes to the bottom logic)
    IF[#142EQ7.5]GOTO300

    IF[#104GT20]THEN#142=10
    IF[#142EQ10]GOTO300

    IF[#104GT18]THEN#142=7.5
    IF[#142EQ7.5]GOTO300

    IF[#104GT15]THEN#142=5
    IF[#142EQ5]GOTO300

    IF[#104GT9.5]THEN#142=0 (here in stead of the top)
    IF[#142EQ0]GOTO200

    IF[#104LT9.5]THEN#142=2.5
    IF[#142GT2.5]GOTO300


    N200

    M95(BAR FEEDER STOCK LENGTH SIGNAL CHECK START)
    /M92(BAR CHANGE PROGRAM) (this just cuts the end of bar only)
    M96(BAR FEEDER STOCK CHECK )

    GOTO3

    N300

    M95(BAR FEEDER STOCK LENGTH SIGNAL CHECK START)
    /M93(BAR CHANGE PROGRAM)
    M96(BAR FEEDER STOCK CHECK)

    N3

    M99
    %

    Here is my bar change program.

    #122=bar od
    #143=macro call loop for pre-cutoff bar

    %
    O9003


    M61
    M10
    M9
    G0X3.T0
    M9
    G97M3S250
    (M00)
    G98G1W-2.5F100.
    M11
    G4U.5
    M62
    G4U1.
    M10
    G4U.5
    M60
    G1W2.5F100.
    G4U1.0


    G50S7500
    G96M3S350
    M8
    M274
    T0808
    G18G99G0X[#122+.100]
    G1X.100F.005
    G1X-.04F.003
    G97M3S200
    M275



    #143=#142

    WHILE[#143GE1]DO1

    M61
    M10
    M9
    G0X[#122+.5]
    M11
    G4U.5
    G98G1W-2.5F100.
    M10
    G4U.5
    M60
    G1W2.5F100.
    G4U1.0


    G96M3S350
    M8
    M274

    G18G99G0X[#122+.100]
    G1X.100F.005
    G1X-.04F.003
    G97M3S200
    M275



    #143=#143-2.5

    IF[#143EQ0]GOTO1


    END1

    N1

    M99
    %


    I hope that this helps.

    @Hardym1 That worked in the sample but not in the program that is in this post.

  11. #11
    Join Date
    Feb 2006
    Posts
    1792

    Re: 31i macro argument issues

    Quote Originally Posted by Hardym1 View Post
    sinha,

    0 is a number. It is not null. #0 will make it null.
    What I meant was #0 is equivalent to number 0 in arithmetic operations.
    Even in comparison, it is equivalent to 0 except in EQ and NE.
    Any undefined variable is same as #0

  12. #12
    Join Date
    Feb 2013
    Posts
    21

    Re: 31i macro argument issues

    I sent you a PM. Let me know if it will work for you

  13. #13
    Join Date
    Sep 2017
    Posts
    15

    Re: 31i macro argument issues

    Quote Originally Posted by Hardym1 View Post
    I sent you a PM. Let me know if it will work for you
    I will give this a try as soon as I can get back to that machine.

  14. #14
    Join Date
    Sep 2017
    Posts
    15

    Re: 31i macro argument issues

    Ohh Crap, I gave the 120" bar change program not the 240", my mistake well the program is all the same but the #100 macro is 231 not 111. Well the issue is still there and was just hoping that someone here maybe able to help me understand why the logic is not working properly.

  15. #15
    Join Date
    Jan 2009
    Posts
    103

    Re: 31i macro argument issues

    In your program the line:
    IF[#104EQ9.525THEN#142=7.5
    is missing close bracket before then

  16. #16
    Join Date
    Sep 2017
    Posts
    15

    Re: 31i macro argument issues

    Quote Originally Posted by mcode View Post
    In your program the line:
    IF[#104EQ9.525THEN#142=7.5
    is missing close bracket before then
    Ya that was a typo here. At the machine it is in there

  17. #17
    Join Date
    Feb 2006
    Posts
    1792

    Re: 31i macro argument issues

    This type of logic sometimes does not work because of floating-point error. In such cases, the difference in the two should be checked against a small number, say 0.0001

  18. #18
    Join Date
    Jan 2009
    Posts
    103

    Re: 31i macro argument issues

    add this line after #104 is defined:
    #104=RND[#104*10000]/10000
    that will round to 4 decimal places

Similar Threads

  1. Gibbs lathe argument
    By houdini in forum GibbsCAM
    Replies: 1
    Last Post: 10-02-2014, 05:27 AM
  2. M65 call with S argument set to zero out of range
    By arauchfuss in forum Haas Mills
    Replies: 0
    Last Post: 04-30-2012, 02:33 PM
  3. E argument in G84?
    By Brian-Gilliam in forum G-Code Programing
    Replies: 1
    Last Post: 09-12-2011, 09:40 PM
  4. Argument Specification II
    By Andre' B in forum NCPlot G-Code editor / backplotter
    Replies: 2
    Last Post: 02-06-2008, 04:46 PM

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
  •