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 > G-Code Programing > Parametric Programing


Parametric Programing (custom macro b, fadal macro, okuma user task)


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-28-2010, 07:27 PM
 
Join Date: Oct 2005
Location: usa
Posts: 2
rlgx4 is on a distinguished road
Custom Macro B

I would like to create a program for a pallet change. All of it I can do except change the main program to match the pallet number.I see that #4115 = the program number but I can only read it( and pass to a variable). Is there a way to call up a program to a pallet without putting it in a sub? Fadal has what I need... I believe it was something like #STARTprog# but what I need is for Fanuc custom macro B.Thanks
Reply With Quote

  #2   Ban this user!
Old 06-28-2010, 10:56 PM
 
Join Date: Jun 2010
Location: USA
Posts: 12
Mike xyz is on a distinguished road

Variable #4115 is the last O number read by the control so it contains the current program number.

I believe that the Fanuc control will run a M98 P#4115 but that would just send your program to the top of the current program sort of like a M99 if there is just one program ( no sub program ).

You could use the #4115 and a math statement to run a certain program.
M98 P[#4115+1] ( O number plus one )

Or you could do an IF statement.
IF[#4115 EQ 100] GOTO100 ( IF IN PROG O100 JUMP TO N100 )
IF[#4115 EQ 200] GOTO200 ( IF IN PROG O200 JUMP TO N200 )
N100
M98 P101 ( RUN PROGRAM O101 )
GOTO999 ( JUMP TO N999 )
N200
M98 P201 ( RUN PROGRAM O101 )
GOTO999 ( JUMP TO N999 )
N999 ( END PROGRAM )
M30
This could be a generic section of program you put in all your programs but it would probably be easer to just figure out where you want to go in a particular program and program a GOTO command.

Just some ideas. Hope this helps.

Best regards.

Mike
Reply With Quote

  #3   Ban this user!
Old 06-29-2010, 02:27 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Let us say you have 10 pallets and 10 programs for them. If you do not want to use subprograms, all the 10 programs would need to be included in the main program. You would need to enter pallet number in the beginning of the program, and the program would jump to appropriate blocks depending on this value. Something like this:

#1 = <enter pallet number>;
IF [#1 EQ 1] GOTO 100;
IF [#1 EQ 2] GOTO 200;
IF [#1 EQ 3] GOTO 300;

...

N100 ;
<machining program for pallet number 1>
GOTO 999;
N200 ;
<machining program for pallet number 2>
GOTO 999;

...

N999 M30;
Reply With Quote

  #4   Ban this user!
Old 06-29-2010, 09:31 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

When it comes to macros there are so many different ways of going about it and it will be decided by preference and what your operator’s capability is.

All the ways suggested above will work.

If I am understanding what you are wanting to do with the limited info we have is setup a custom M or G code or subprogram call to call the pallet change program in your main program but when it is finished changing pallets you want your main program to know which pallet is in the machine?

Well it will depend if you have a system variable to track the current pallet in the machine that would be ideal. If not you can set up a variable to do so. How many pallets do you have?

I would go about it in this way. If you have a system variable that tracks the current pallet then I would set up a custom M-code for a pallet change say M60. Now let’s say #1010 is the system variable that tracks the current pallet. Your M60 is going to call program 9020 to change pallets. Your main program is 1 and your subprogram for machining of pallet 1 is 1001 and your subprogram for machining of pallet 2 is 1002. These program numbers can be changed to suite what you want, I was just using them as reference.

O0001(main program)

M60
M98P#501
M30

O9020(pallet change program)

…(pallet change sequence)
#500=#1010
#501=#500+1000
M99

Now you will have to make sure that you are not using the #500 and #501 for anything else. If so we can make them different variables.

All of the stuff above has only been rambled and typed up in the last 5 minutes. I had no time to proof read or try so take it with a grain of salt.

Stevo
Reply With Quote

  #5   Ban this user!
Old 06-29-2010, 06:25 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

The method that has evolved on our twin pallet machine is to allocate extended work offsets P1-24 to pallet 1, and P25-47 to pallet 2.

The main program first calls a standard sub program we always use to define the current Tool/Work Offsets in use.

It then calls an offset rotation macro (at every N number), which loads the relevant pallet if necessary, before rotating B, setting the running offset as P48 and returning to the main program. We have set a custom G-code to call this, which keeps it all tidy.

We use the status of the proximity switches to determine position of pallets.

DP
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-29-2010, 07:16 PM
 
Join Date: Oct 2005
Location: usa
Posts: 2
rlgx4 is on a distinguished road

Stevo
That is exactly what I want. Your ref to the m codes and bit calls are what I have on this machine (#1010= pallet 1 #1011= pallet 2 ) I've done similar to what is mentioned above. I didn't want to put it in a sub if the the operator hits reset and when they try to restart a potential crash will happen.On the Fadal I ran it had the #start that would change the main program.I was just curious to see if Fanuc had something similar couldn't find anything in the manual.Ran out of time today but was going to see if I called a sub up and put an M30 at the top to see if it would force it to stay at that program.We have around 75 entry level operators and 4 setup guys trying to help them out as much as possible.
Reply With Quote

  #7   Ban this user!
Old 06-30-2010, 08:06 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

What do you mean if you hit rest they could crash on startup? Going by program 1 it will always call the proper program for the proper pallet in the machine.

Now if you are talking about starting at a specific area in a program based on having to stop the process mid cycle then I would not trust anything other than actually resetting to the beginning of the main program. A few options with this would be to have a starting sequence for the pallet number and the operation you want to jump to. I have done this in a few processes. However my consisted of about 30 macros with 20 tools all running together on complex parts. Just a matter of plugging in the 6 digit code for where you wanted to start.

You would make a laminated sheet that has a number the correlates to the operation and the pallet number. Say pallet 1 operation 30 so at the beginning of the main program you would have a variable like #1=130. Now with a bunch of calculations you can verify pallet, operation, tools, positions, etc it would go to that operation and run.

There are so many different ways of doing this when it comes to macros. My job is to always find the best way along with the most error proof way. I write all my calculations with the question in my head “what if the operator does this”. You have to account for every scenario.

I may be reading a bit more into what you are looking for but if you tell me step by step what you’re looking to do and why I can lend a better hand. Do you want all of your machining in a main program? What kind of restart options are you looking for? etc, etc.

Stevo
Reply With Quote

  #8   Ban this user!
Old 08-02-2010, 04:05 PM
 
Join Date: Feb 2006
Location: United States
Posts: 273
dpuch is on a distinguished road

Personally our 2 pallet setup is a standard main program that does the pallet checks and calls the "normal" part programs needed on that pallet.

very simple sudo code outline to show the idea:
Code:
O0001 (main program)
#101 = 1234 (first program on pallet 1)
#102 = 0 (second program on pallet 1)
#103 = 0 (third program on pallet 1)

#201 = 3422 (first program on pallet 2)
#202 = 2515 (second program on pallet 2)
#203 = 0 (third program on pallet 2)

if [#501=2] goto 200 (manually set 501 to start on pallet 2)

(Pallet 1 check)
(skip any that are =0)
call #101
call #102
call #103

(Pallet change to 2)
M90
N200
(Pallet 2 check)
(skip any that are =0)
call #201
call #202
call #203

(Pallet change to 1)
M90
M99
Reply With Quote

Reply




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? cncwhiz Fanuc 9 06-23-2010 10:11 PM
"difference between Custom Macro A and Custom Macro B" arulthambi Parametric Programing 4 10-05-2009 03:34 PM
Custom macro!!!! chrisryn G-Code Programing 4 05-27-2008 10:13 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 01:03 AM.





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