Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

macro variables to give operator instructions HELP!!!


Recommended Posts

good morning peers!

 

so I am working on something new at work and I came across an article on the web where you can kind of cancel out cycle start and instead use the Y or the N in order to cycle start the machine once again after an M00. I think I am doing it correct but it keeps giving me an error on the IF part and on the GOTO... part I kind of understand because it is reading it as a tool for T and circular motion for I. is there any way I can fix this without making it a comment line? or does anyone know what I am doing wrong? please help!!!!!!!!!!!!!!!!!!!!!!! thank you

 

below is part of my post.

 

 

 

 

 

N1527 X-17.6479 Y-.7956 I-.1875 J0.

N1528 G1 Z4.0452 F50.

N1529 G0 Z6.1152

N1530 M5

N1531 G91 G28 Z0. M9

N1532 G0 G90 X-16. Y10. A0.

N1533 M0 (ADD BOLT TO CENTER POCKET)

N1534 M109 P501 (ARE THE CLAMPS REMOVED Y OR N)

N1535 IF [#501 EQ 0] GOTO1534 (WAIT FOR BUTTON SELECTION) <-- where I get the error

N1536 IF [#501 EQ 89.] GOTO1538 (Y BUTTON PUSHED) <--

N1537 IF [#501 EQ 78.] GOTO1533 (N BUTTON PUSHED) <--

N1538 T17 M6

N1539 G0 G90 G54 X-18.6447 Y1.2459 A0. S5210 M3

N1540 G43 H17 Z6.2152

N1541 M8

N1542 Z4.4652

N1543 G1 X-18.6401 Y1.2962 Z4.4626 F40.

N1544 X-18.6318 Y1.346 Z4.4599

N1545 X-18.62 Y1.3951 Z4.4573

Link to comment
Share on other sites
N1527 X-17.6479 Y-.7956 I-.1875 J0. 
N1528 G1 Z4.0452 F50. 
N1529 G0 Z6.1152 
N1530 M5 N1531 G91 G28 Z0. M9 
N1532 G0 G90 X-16. Y10. A0. 
N1533 M0 (ADD BOLT TO CENTER POCKET) 
N1534 M109 P501 (ARE THE CLAMPS REMOVED Y OR N) 
N1535 IF [#501 EQ 0] GOTO1534 (WAIT FOR BUTTON SELECTION) <-- where I get the error 
N1536 IF [#501 EQ 89.] GOTO1538 (Y BUTTON PUSHED) <-- 
N1537 IF [#501 EQ 78.] GOTO1533 (N BUTTON PUSHED) <-- 
N1538 T17 M6 
N1539 G0 G90 G54 X-18.6447 Y1.2459 A0. S5210 M3 
N1540 G43 H17 Z6.2152 
N1541 M8 
N1542 Z4.4652 
N1543 G1 X-18.6401 Y1.2962 Z4.4626 F40. 
N1544 X-18.6318 Y1.346 Z4.4599 
N1545 X-18.62 Y1.3951 Z4.4573 

What control are you using? Haven't seen the M109 before but I assume it works similar to a VBA msgbox. Also I am not sure what you mean by "I kind of understand because it is reading it as a tool for T and circular motion for I."

Link to comment
Share on other sites
N1527 X-17.6479 Y-.7956 I-.1875 J0. 
N1528 G1 Z4.0452 F50. 
N1529 G0 Z6.1152 
N1530 M5 
N1531 G91 G28 Z0. M9 
N1532 G0 G90 X-16. Y10. A0. 
N1533 M0 (ADD BOLT TO CENTER POCKET) 
N1534 #3009=501	(ENTER 0, 89, 78
(N1534 M109 P501 (ARE THE CLAMPS REMOVED Y OR N) 
N1535 IF [#501 EQ 0] GOTO1534 (WAIT FOR BUTTON SELECTION) <-- where I get the error 
N1536 IF [#501 EQ 89.] GOTO1538 (Y BUTTON PUSHED) <-- 
N1537 IF [#501 EQ 78.] GOTO1533 (N BUTTON PUSHED) <-- 
N1538 T17 M6 
N1539 G0 G90 G54 X-18.6447 Y1.2459 A0. S5210 M3 
N1540 G43 H17 Z6.2152 
N1541 M8 
N1542 Z4.4652 
N1543 G1 X-18.6401 Y1.2962 Z4.4626 F40. 
N1544 X-18.6318 Y1.346 Z4.4599 
N1545 X-18.62 Y1.3951 

Well, I used Ncplot's #3009 variable to mimic the M109 function on your control. The logic seems to work fine in ncplot at least. What alarm is the control throwing?

Link to comment
Share on other sites

its on the IF part. the haas machine recognizes it as it if were going to do a circular motion because of the I it does not read it as the word IF. also, on the GOTO... part the machine only sees the T for tool I believe so the 3 coding lines it will not read them or I rather say the machine gives me an alarm saying its an illegal line.

Link to comment
Share on other sites

so I got it to work! the only weird thing is I don't know why I have to press y and cycle start? I thought you only had to press Y in order for it to start working?

 

on this program after the first #501=0. it wont cycle start?  and if I manage to somehow cycle start it wont respect the second #501=0.  so that way the next run the macro #501 would be at 0.

 

 

 

 

 

%

O0089

N2 G20

N3 G0 G17 G40 G49 G80 G90

N4 T2 M6

N5 G0 G90 G55 X.267 Y15.6718 A0. S2000 M3

N6 G43 H2 Z13.1592

N7 M8

N8 G98 G81 Z12.1092 R12.4092 F10.

N9 G80

N10 M5

N11 G91 G28 Z0. M9

N12 A0.

N13 G28 X0. Y0. A0.

N14 M00 (ADD BOLT TO CENTER POCKET)

#501=0.

N15 M109 P501 (ARE THE CLAMPS REMOVED Y OR N)

N16 IF [#501 EQ 0. ] GOTO14 (WAIT FOR BUTTON SELECTION)

N17 IF [#501 EQ 89.] GOTO19 (Y BUTTON PUSHED)

N18 IF [#501 EQ 78.] GOTO14 (N BUTTON PUSHED)

N19 T2 M6

N20 G0 G90 G55 X.267 Y15.6718 A0. S2000 M3

N21 G43 H2 Z13.1592

N22 M8

N23 G98 G81 Z12.1092 R12.4092 F10.

N24 G80

N25 M5

N26 G91 G28 Z0. M9

N27 G28 X0. Y0. A0.

#501=0

N28 M30

%

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...