585,729 active members*
4,488 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Posts
    214

    Local variables

    Guys -

    Is it better to clear local variables (Parameter 6001 bit 7=0) every time you re set your machine, or it does not matter.
    I'm confuse??
    If I run
    G65P9001X10Z20A100B105 then I change program(different job)
    G65P9102X20Z10C250D205 does G65 resets new values????

    Regards
    George

  2. #2
    Join Date
    Mar 2005
    Posts
    1498
    070216-1624 EST USA

    jorgehrr:

    Why does it matter? Local variables are volatile so you expect to load them before use.

    On a HAAS when you do a G65 call to a subroutine there is a whole new set of local variables created, and these are associated with parameters on the G65 calling line.

    Do your own experiments.

    Create a program like this:

    #1 = 10.0
    #2 = 12.0
    #101 = #1
    #102 = #2
    G65 P1000 B22.0
    #111 = #1
    #112 = #2
    M00

    N1000
    #103 = #1
    #104 = #2
    #1 = 15.0
    #105 = #1
    M99

    After execution on a 1993 HAAS VF-2 the results are:

    101 = 10.0
    102 = 12.0
    103 = empty
    104 = 22.0
    105 = 15.0

    111 = 10.0
    112 = 12.0

    Note: on going into the subroutine the local variables in the subroutine are cleared, and those associated with a parameter on the subroutine calling line are loaded with the calling line value.

    Changes to a local variable within a subroutine are not passed back out of the subroutine when the subroutine returns.

    Local variables that had a value before the subroutine call are unchanged when returning to the calling level.

    .

  3. #3
    Join Date
    May 2006
    Posts
    214
    Thank you very much.

    I'm new with macros and I couldn't understand a lot of stuff, I'm doing better now thanks to guys like you that share what they know.

    Again, thank you for your help.



    Jorge

  4. #4
    Join Date
    Mar 2005
    Posts
    1498
    jorgehrr:

    Do not hesitate to ask questions when something is not clear. Often a bit of information is what you need to get by an impasse. Learn the fundamentals and develop an intuitive understanding of what you are working on.

    One kind of question I do not care for is when someone wants a specific question answered but is unwilling to learn the fundamentals so that they can answer a similar question on their own in the future.

    .

  5. #5
    Join Date
    May 2006
    Posts
    214

    You are 100% Right.

    Regards

    George

Similar Threads

  1. Wisconsin area forming a local informal group
    By skypilot in forum Mentors & Apprentice Locator
    Replies: 30
    Last Post: 08-30-2011, 02:58 AM
  2. Anyone bitten by the cnc bug in Ohio? Local chapter starting!
    By ballscrewed in forum Mentors & Apprentice Locator
    Replies: 126
    Last Post: 03-06-2011, 09:26 PM
  3. any Australians in here with local suppliers
    By dave05 in forum DIY CNC Router Table Machines
    Replies: 6
    Last Post: 09-05-2006, 11:00 PM
  4. G65 local variables help
    By FanukRC in forum G-Code Programing
    Replies: 7
    Last Post: 07-26-2006, 12:00 AM
  5. Local Transformer Source
    By andy_ck87028 in forum Australia, New Zealand Club House
    Replies: 2
    Last Post: 02-13-2006, 09:40 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
  •