584,850 active members*
4,416 visitors online*
Register for free
Login
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2006
    Posts
    1792

    macro variables

    Certain variables are always integer (such as a loop counter), and certain others are always real (such as an axial distance). Is a differentiation made between integer and real macro variables? For example, is the following a valid statement:
    #100=1.0
    G#100 X... Y... F...
    Is this a valid G01 statement or we have to define #100=1 (an integer)?
    Are 1.0 and 1 always equivalent in macro expressions, the control automatically interpreting it as either real or integer, as appropriate?

  2. #2
    Join Date
    Sep 2007
    Posts
    217
    That would be an ok statement for that varaible. I have gone as far as this:

    G#100 X#101 Y#102 Z#103 A#104 C#105 F#106 S#107 M#108

    #100 = 1
    #101 = 3.5
    #102 = 2.5
    #103 = 1.
    #104 = 45
    #105 = 15
    #106 = 4000
    #107 = 40000
    #108 = 303

  3. #3
    Join Date
    Nov 2005
    Posts
    219
    You can also use it for drill cycles

    #1=73.

    G#1

  4. #4
    Join Date
    Feb 2006
    Posts
    1792
    Ok. So, it is automatic 'rounding' of macro variables whereever appropriate (1.0 being interpreted as 1, to suit a G code). But is it true for non-macro statements also? For example, can you please check on your machine if G1.0 does not give any error, and is same as G01? I am making this request because the original Fanuc control is not accessible to me at this point of time.

  5. #5
    Join Date
    Mar 2003
    Posts
    2932
    G1.0 is not a valid G-code on any Fanuc (as far as I know), so it should result in an error (P/S 010 on 16i, 18i, and 21i, for example).

    If you assign #100=1, or #100=1., or #100=1.0, then G#100 is a valid g-code because the value of 1 is used. If you assign #100=1.1 then you should get an alarm when G#100 is read.

  6. #6
    Join Date
    Feb 2006
    Posts
    1792
    Quote Originally Posted by dcoupar View Post
    G1.0 is not a valid G-code on any Fanuc (as far as I know), so it should result in an error (P/S 010 on 16i, 18i, and 21i, for example).

    If you assign #100=1, or #100=1., or #100=1.0, then G#100 is a valid g-code because the value of 1 is used. If you assign #100=1.1 then you should get an alarm when G#100 is read.
    Thanks. You have exactly answered my query.
    Actually, in any high-level computer language, you cannot give a real value in place of an integer value (though integer for real is permitted), and this was the source of my confusion.

Similar Threads

  1. Convert Fanuc Macro to Fadal Macro
    By bfoster59 in forum Fadal
    Replies: 1
    Last Post: 11-09-2007, 06:41 AM
  2. Variables 500 to 531
    By viorel26 in forum Fanuc
    Replies: 0
    Last Post: 09-30-2007, 08:30 AM
  3. Variables/Macro uses....
    By theemudracer in forum Fanuc
    Replies: 12
    Last Post: 12-13-2006, 08:45 PM
  4. Variables/Macro use ????
    By theemudracer in forum G-Code Programing
    Replies: 2
    Last Post: 12-11-2006, 04:47 PM
  5. G65 local variables help
    By FanukRC in forum G-Code Programing
    Replies: 7
    Last Post: 07-26-2006, 12:00 AM

Posting Permissions

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