- Newbie- Constantly changing variable in macro
-
Member
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:
-
-
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
-
Member
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
-
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
- Newbie- Constantly changing variable in macro
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
-
Forum Rules