585,744 active members*
4,021 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1

    Constantly changing variable in macro

    I’ve made a macro program to machine a angle from the face of a part. The angle likes to move a lot so I have to constantly adjust the variable in the G65. Let’s say this angle is stored in the “A” . Can I set a variable at the top of the main program to edit my “A” ?

  2. #2
    Join Date
    Aug 2007
    Posts
    413

    Re: Constantly changing variable in macro

    Yes you can with lokal or global variables.

    Example:
    N11
    IF [#970 NE 4902] GOTO 12
    G65 P#970 X#11 Y#12 Z#996 R#988 I#974 D#977 E#978 F#979
    M99

  3. #3

    Re: Constantly changing variable in macro

    So I can for example set #100 equal to my angle value at the top of my main program, set my A equal to the #100 variable, and the main program will pass the value of #100 to my A which will then pass that value into the macro as #1 since variable A=#1?


    (Top Of Program)
    #100=50
    ..
    Program
    ..
    G65 P(Macro Program Number) A#100

  4. #4
    Join Date
    Aug 2007
    Posts
    413

    Re: Constantly changing variable in macro

    You can also pre-process the value before passing it to the macro.
    For example:

    #100=COS[#101]*#102
    ...

    G65 Pnn A#100

Similar Threads

  1. Okuma Macro Variable value Driven Variable
    By ablackwell in forum Okuma
    Replies: 4
    Last Post: 06-12-2021, 05:11 AM
  2. Looking for the macro variable no. For.....
    By gavintwopies in forum Daewoo/Doosan
    Replies: 3
    Last Post: 10-31-2020, 03:20 PM
  3. Macro variable name
    By positiverake in forum Fanuc
    Replies: 3
    Last Post: 10-27-2020, 06:32 PM
  4. Accessing Macro Variable from another macro
    By ex-egll in forum Mach Wizards, Macros, & Addons
    Replies: 1
    Last Post: 02-01-2014, 06:52 AM
  5. Replies: 0
    Last Post: 11-24-2010, 09:00 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
  •