Newbie Constantly changing variable in macro


Results 1 to 3 of 3

Thread: Constantly changing variable in macro

  1. #1
    Member vibinandgrovin's Avatar
    Join Date
    Sep 2022
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default 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” ?

    Similar Threads:


  2. #2
    eckitsch's Avatar
    Join Date
    Aug 2007
    Location
    Suhl
    Posts
    413
    Downloads
    0
    Uploads
    0

    Default 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
    Member vibinandgrovin's Avatar
    Join Date
    Sep 2022
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default 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
    eckitsch's Avatar
    Join Date
    Aug 2007
    Location
    Suhl
    Posts
    413
    Downloads
    0
    Uploads
    0

    Default 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



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
  •  


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

Constantly changing variable in macro

Constantly changing variable in macro