CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > Fanuc


Fanuc Discuss Fanuc controllers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-30-2010, 05:07 AM
 
Join Date: Nov 2010
Location: Denmark
Posts: 21
Lene Madsen is on a distinguished road
Question Custom Macro A alarm 76

Hi all!

I hope some of you can help me deal with a problem I get when I make a program in Custom Macro A for a Fanuc O-MD, 3-axis milling machine.
My problem is that when I try to run my program (posted at the bottom) I get alarm 076 address P not defined.
I have tried to define my P#values both at the main program, in variables definition of main program and later I tried to define them in the subprogram. Neither seemed to get rid of the problem, and since I haven’t been able to find much help on macro A I seem to be stuck.
The program has to drill 9 holes (3x3) in each of 8 parts that are lined up as 4x2
I am new to CNC programming so it might be some very basic knowledge I’m lacking. I really hope someone can help!

Thanks!

Regards,
Lene Madsen

O0010 Main program

G17 G40 G54 G21 G90 ;
M6 T1;
G00 X0 Y0 Z0,5 S400 M13;
G65 H01 P#121 Q4000
G65 H01 P#122 Q4000
G65 H01 P#123 Q8500
G65 H01 P#124 Q8500
G65 H01 P#125 Q3
G65 H01 P#126 Q3
G65 H01 P#127 Q0
G65 H01 P#128 Q0
G65 H01 P#129 Q2
G65 H01 P#130 Q2
G65 H01 P#131 Q25000
G65 H01 P#132 Q25000
M98 P1010
G00 Z100;
G00 X0 Y200;

O1010 Custom macro A

G65 H01 P#101 Q1
G65 H01 P#102 Q#128
N1 G65 H83 P99 Q#101 R#130
G65 H01 P#103 Q1
G65 H01 P#104 Q#127
N5 G65 H83 P80 Q#103 R#129
G65 H01 P#105 Q1
G65 H01 P#106 Q#122
N10 G65 H83 P75 Q#105 R#126
G65 H01 P#107 Q1
G65 H01 P#108 Q#121
N15 G65 H83 P50 Q#107 R#125
G81 X#108 Y#106 R0,1 Z-13,1 F50
G80
G65 H02 P#107 Q#107 R1
G65 H02 P#108 Q#108 R#123
G65 H80 P15
N50 G65 H02 P#105 Q#105 R1
G65 H02 P#106 Q#106 R#124
G65 H80 P10
N75 G65 H02 P#103 Q#103 R1
G65 H02 P#104 Q#104 R#131
G65 H80 P5
N80 G65 H02 P#101 Q#101 R1
G65 H02 P#102 Q#102 R#132
G65 H80 P1
N99 M99


I first created the program in macro B (I was advised to do so, but I had ofcourse no way of testing this)

#24 X 4
#25 Y 4
#21 U 8,5
#22 V 8,5
#23 W 3
#11 H 3
#1 A 0
#2 B 0
#3 C 2
#7 D 2
#8 E 25
#9 F 25

O0010 Main program
M6 T1;
G17 G40 G54 G21 G90 ;
G00 X0 Y0 Z10 S400 M13;
G65 P1010 X4 Y4 U8,5 V8,5 W3 H3 A0 B0 C2 D2 E25 F25 ;
G00 Z100;
G00 X0 Y200;

O1010 Custom macro B
G00 X#24 Y#25
#121 = 1
#122 = #2
N1 IF[#121 GT #7] GOTO 99
#131 = 1
#132 = #1
N5 IF[#131 GT #3] GOTO 80
#111 = 1
#112 = #25
N10 IF[#111 GT #11] GOTO 75
#101 = 1
#102 = #24
N15 IF[#101 GT #23] GOTO 50
G81 X#102 Y#112 R0,5 Z-13,5 F50
G80
#101 = #101 + 1
#102 = #102 + #21
GOTO 15
N50 #111 = #111 + 1
#112 = #112 + #22
GOTO 10
N75 #131 = #131 + 1
#132 = #132 + #8
GOTO 5
N80 #121 = #121 +1
#122 = #122 + #9
GOTO 1
N99 M99

Last edited by Lene Madsen; 11-30-2010 at 05:37 AM. Reason: added macro B program
Reply With Quote

  #2   Ban this user!
Old 11-30-2010, 05:42 AM
 
Join Date: May 2007
Location: south korea
Age: 54
Posts: 42
Sung daecheol is on a distinguished road

Dear Lene,
Could you tell me result of try as follows(Delete or skip M,S,T code and insert M30 at the end of Main program).
(M6 T1);
(G00 X0 Y0 Z0,5 S400 M13);
.
.
.
G65 H01 P#132 Q25000
M98 P1010
G00 Z100;
G00 X0 Y200;
M30

Daecheol Sung
Reply With Quote

  #3   Ban this user!
Old 11-30-2010, 10:47 AM
viorel26's Avatar  
Join Date: Jun 2007
Location: Romania
Age: 31
Posts: 102
viorel26 is on a distinguished road

O0010 Main program

G17 G40 G54 G21 G90 ;
M6 T1;
G00 X0 Y0 Z0,5 S400 M13;
G65 H01 P#121 Q4000
G65 H01 P#122 Q4000
G65 H01 P#123 Q8500
G65 H01 P#124 Q8500
G65 H01 P#125 Q3
G65 H01 P#126 Q3
G65 H01 P#127 Q0
G65 H01 P#128 Q0
G65 H01 P#129 Q2
G65 H01 P#130 Q2
G65 H01 P#131 Q25000
G65 H01 P#132 Q25000
M98 P1010
G00 Z100;
G00 X0 Y200;
M30


O1010 Custom macro A

G65 H01 P#101 Q1
G65 H01 P#102 Q#128
N1
G65 H83 P99 Q#101 R#130
G65 H01 P#103 Q1
G65 H01 P#104 Q#127
N5
G65 H83 P80 Q#103 R#129
G65 H01 P#105 Q1
G65 H01 P#106 Q#122
N10
G65 H83 P75 Q#105 R#126
G65 H01 P#107 Q1
G65 H01 P#108 Q#121
N15
G65 H83 P50 Q#107 R#125
G81 X#108 Y#106 R0,1 Z-13,1 F50
G80
G65 H02 P#107 Q#107 R1
G65 H02 P#108 Q#108 R#123
G65 H80 P15
N50
G65 H02 P#105 Q#105 R1
G65 H02 P#106 Q#106 R#124
G65 H80 P10
N75
G65 H02 P#103 Q#103 R1
G65 H02 P#104 Q#104 R#131
G65 H80 P5
N80
G65 H02 P#101 Q#101 R1
G65 H02 P#102 Q#102 R#132
G65 H80 P1
N99
M99
Reply With Quote

  #4   Ban this user!
Old 11-30-2010, 02:30 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

I answered your post last night, but I don't see it here this morning. Not sure what happened there.

Anyway, the format you're using to define P is correct with User Macro A. In the following example, P would take on the value of Q, being 4000

G65 H01 P#121 Q4000

When a program contains macro statements, and the control alarms for no obvious reason due to something related to the Macro statements, try isolating a line of code that the error message relates to, in a program by itself and try running it. For example, construct the following program and run it.

O1000
G65 H01 P#121 Q4000
M00
M30
%

1. If the program errors and displays the same error message that you have been experiencing, then you have an issue with the control because the code in the above program is viable.

2. If the program runs without an error, and when it stops at the compulsory stop M00, look up variable 121 in the Macro variable register and check that the value 4000 has been stored in the corresponding variable.

3. Continue to add to this program one block at a time, the blocks from your original program, but include the M00 just before the end of the program.

4. After each inclusion of the additional block, run the program to see if you get the error and check the variable as in point 2 above.

This may sound a bit tedious, but when you have an error situation that is occurring for no obvious reason, this is a good way of finding the cause, particularly when the program is relatively short as yours is.

Please post the result if you decide to run this test.

Regards,

Bill
Reply With Quote

  #5   Ban this user!
Old 12-01-2010, 09:59 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Or if you are just learning CNC programming then you may want to use macroB instead. This is more current with machine programming then A. I am never against learning something no matter how old it is but it is definitely 2 breeds of programming and macroB will help you longer term. You will also find more support to B then A. I am taking nothing away from the people already helping and their suggestions.

Sorry I know read the rest of your post with the macroB code. May I ask why you were advised to write this in macroB first?

Can anyone tell that I hate macroA??

Stevo
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-06-2010, 02:07 AM
 
Join Date: Nov 2010
Location: Denmark
Posts: 21
Lene Madsen is on a distinguished road

Sung and Angelw:

I will be trying both your suggestions once the machine is off duty, thank you very much both!

Stevo1:

The particular machine I am running only has the option to program in macroA.
I was adviced to write in macroB since they mostly differ on syntax. Is that wrong?
Reply With Quote

  #7   Ban this user!
Old 12-06-2010, 05:07 AM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by Lene Madsen View Post
Sung and Angelw:

I will be trying both your suggestions once the machine is off duty, thank you very much both!

Stevo1:

The particular machine I am running only has the option to program in macroA.
I was adviced to write in macroB since they mostly differ on syntax. Is that wrong?
The syntax of Macro B is very much like Basic or Pascal and is quite intuitive and relatively easy to read. Macro A, on the other hand, uses codes to represent functions and accordingly, you have to know what the codes represent to be able to read the program.

In the following example the two Macro statements have the same function, but the Macro B code is far easier to read.

Macro A------------------------------Macro B
G65 H02 P#101 Q#102 R15------------#101 = #102 +15

I can well imagine someone suggesting you write the program in Macro B, then transpose the Macro A function code to perform the same task, because of the better readability of Macro B. However, the same could be achieved by drawing a Flow Chart, which is the approach taken when designing software.

The attached picture is an example of a flow chart just to illustrate how symbols, lines, and directional arrows can be used to show functions, conditional statement etc in a graphical, easy to follow form. Flow charts are often just quick hand sketches to allow you to better visualize the logic of your program.

Regards,

Bill

Click image for larger version

Name:	Flow Chart1.JPG
Views:	23
Size:	8.6 KB
ID:	120808

Last edited by angelw; 12-07-2010 at 01:22 AM.
Reply With Quote

Reply

Tags
alarm 76, macro a




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Macro Containing G65 LostInMacro Fanuc 21 09-15-2010 03:21 PM
Custom Macro B rlgx4 Parametric Programing 7 08-02-2010 04:05 PM
"difference between Custom Macro A and Custom Macro B" arulthambi Parametric Programing 4 10-05-2009 03:34 PM
Custom Macro B On A 18t. JIMMYZ Fanuc 3 10-18-2006 10:08 PM
custom macro The Metal Daewoo/Doosan 2 09-28-2006 07:26 AM




All times are GMT -5. The time now is 09:31 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361