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 10-26-2011, 02:22 PM
 
Join Date: Sep 2011
Location: USA
Posts: 71
MCImes is on a distinguished road
How do I set a Custom G code?

Hello,
I am going to make a custom G code on my swiss lathe with a Fanuc 18i-TB control. I had one at my last work and have an idea of what im doing but I didnt set it up and need a little direction.

I know I need to set parameter 6050-6059 to a number and I need a program with my custom macro with a 9001-9009 prog number I think.

So, my question is:
-what does the parameter # correspond to
-what do i need to set the parameter # to?

If I remember right I think 6050 is g60, 51 is g61 ect but I forget.

thanks for any help
__________________
I program, setup and run Swiss lathes with Fanuc controls
Reply With Quote

  #2   Ban this user!
Old 10-26-2011, 04:40 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by MCImes View Post
Hello,
I am going to make a custom G code on my swiss lathe with a Fanuc 18i-TB control. I had one at my last work and have an idea of what im doing but I didnt set it up and need a little direction.

I know I need to set parameter 6050-6059 to a number and I need a program with my custom macro with a 9001-9009 prog number I think.

So, my question is:
-what does the parameter # correspond to
-what do i need to set the parameter # to?

If I remember right I think 6050 is g60, 51 is g61 ect but I forget.

thanks for any help

-what does the parameter # correspond to

The parameter number relates to a program number as shown below.

-what do i need to set the parameter # to?

You register a numeric value that corresponds to the custom G code you wish to create. For example. I use G100 to launch a Tool Length measuring User Macro program. I can use this G code in a program or via MDI when measuring tool length. In this case, the number 100 is registered in the parameter that corresponds to the Macro Program number I wish to use, or is available (9010 to 9019).

If I remember right I think 6050 is g60, 51 is g61 ect but I forget.
These parameters don't relate to any G code unless a number has been registered therein. If these parameters already have numbers registered, ie 60, 61, etc, then they are already being used, perhaps by special G codes created by the OEM. If this is the case, then they are unavailable to you and can't be used without destroying the relationship with existing G codes that are calling these Macro programs numbers.

Regards,

Bill

6050 G code that calls the custom macro of program number 9010
6051 G code that calls the custom macro of program number 9011
6052 G code that calls the custom macro of program number 9012
6053 G code that calls the custom macro of program number 9013
6054 G code that calls the custom macro of program number 9014
6055 G code that calls the custom macro of program number 9015
6056 G code that calls the custom macro of program number 9016
6057 G code that calls the custom macro of program number 9017
6058 G code that calls the custom macro of program number 9018
6059 G code that calls the custom macro of program number 9019
Reply With Quote

  #3   Ban this user!
Old 10-26-2011, 07:34 PM
 
Join Date: Sep 2011
Location: USA
Posts: 71
MCImes is on a distinguished road

exactly what I needed. Thanks! Im going to make a turn/dwell chip breaker macro to make my chips more manageable. It will be very nice. Thanks again
__________________
I program, setup and run Swiss lathes with Fanuc controls
Reply With Quote

  #4   Ban this user!
Old 10-27-2011, 07:49 AM
 
Join Date: Sep 2011
Location: USA
Posts: 71
MCImes is on a distinguished road

I thought that I had a copy of the chip breaker turn/dwell program from my old machine but I seem to have misplaced it. So anyone want to help me write one? or if you have one post it?

I thought it looked something like this:

%9010

#1 =z end
#2 =turn distance/chip break
#3 =dwell
#4 =feed

IF [#2 LT0] goto2
IF [#3 LT0] goto3
IF [#4 LT0] goto4

#1= #5401 (not sure if #5401 is correct but i think its close)
while [current position LT #1] DO1
G1 W#2 f#4
G4 U#3
END1

m99

N2 (Bad Distance)
(alarm code?)

N3 (Bad Dwell)
(alarm code?)

N4 (Bad Feed)
(alarm code?)
%

My questions are
-How do I define my current Z position. If I remember the old program correctly I thought it was #1=#5401 but I could be wrong.

-I want to write the code in the program as G65 Z(end) Q(chip break) D(dwell) F(feed). How do I link Z,Q,D, and F to my sub program? Can I say #2=Q? Or do I use some parameter #'s like Q=#5403?

-At the end of the program how do I get it to alarm if a value is missing? what code or parameter do I put there?

-In my WHILE statement should I use a Z or W for my feed move? Does it matter? Do I have it written correctly that the loop will end when it hits my end point or could it possibly over-turn by going to the end of the last chip break assuming the chip break distance is not divisible by the overall distance.

I know thats kinda a lot so thanks a bunch in advance!
__________________
I program, setup and run Swiss lathes with Fanuc controls
Reply With Quote

  #5   Ban this user!
Old 10-27-2011, 05:01 PM
 
Join Date: Sep 2011
Location: USA
Posts: 71
MCImes is on a distinguished road

Anyone know what "buffer overflow" means immediately after hitting read>execute?
__________________
I program, setup and run Swiss lathes with Fanuc controls

Last edited by MCImes; 10-27-2011 at 05:23 PM.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-27-2011, 08:06 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by MCImes View Post
Anyone know what "buffer overflow" means immediately after hitting read>execute?
Obviously you're reading data from an external device. Do you see that data starts to be sent from the sending device? Is this a new problem that has only just occurred?

Buffer overflow alarm normally occurs when the receiving device doesn't send an Xoff handshake signal when software handshaking is used, or doesn't switch the CTS to logic 0 if hardware hand shaking is being used. Alternatively, the sending device does not recognize the handshake, and keeps sending data. In either case the Input Buffer of the receiving device will overflow.

Post more details on the matter so that more considered advice can be given.

Regards,

Bill
Reply With Quote

  #7   Ban this user!
Old 10-27-2011, 08:37 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

It is also due to having the baudrate not set properly. Your 18i should be fine but some of the older controls could only receive so much into the buffer when sending a program. IIRC some could only receive 10 characters when the PC was sending 15. Try slowing down your baudrate and also make sure that the baudrate set in the PC matches the CNC.

Stevo
Reply With Quote

  #8   Ban this user!
Old 10-27-2011, 10:22 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Just to add a bit to Stevo's good advice.

Slowing the baud rate is a bit of a Fudge Fix. Overrun when all settings are correct normally occurs due to the PC not being able to react quick enough when told to stop sending data. This happens more so with Software Handshaking, where the Xoff, control character DC3 (Ascii 19), is interpreted at system level. The issue frequently is with the serial port itself and can be rectified in some cases by using a lower FIFO setting. This setting is accessible through the Advanced Port Setting in the Device Manager. Unequal baud rate between machine control and PC will give a Framing error.

Regards,

Bill
Reply With Quote

  #9   Ban this user!
Old 10-28-2011, 03:49 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Originally Posted by MCImes View Post
Hello,
I am going to make a custom G code on my swiss lathe with a Fanuc 18i-TB control. I had one at my last work and have an idea of what im doing but I didnt set it up and need a little direction.

I know I need to set parameter 6050-6059 to a number and I need a program with my custom macro with a 9001-9009 prog number I think.

So, my question is:
-what does the parameter # correspond to
-what do i need to set the parameter # to?

If I remember right I think 6050 is g60, 51 is g61 ect but I forget.

thanks for any help
Read the attachment for more details on custom G-codes.
Attached Files
File Type: pdf Macro call with user-defined g-codes.pdf‎ (64.9 KB, 23 views)
Reply With Quote

  #10   Ban this user!
Old 10-28-2011, 09:38 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Yes Bill you are correct. I was just going from memory last night with no reference material. My book states that it is usually the FIFO buffers on the PC. This is a very common problem on the 10 and 11 series fanucs

The other 2 things that my book says is the program could be missing the O or : at the beginning of the program number. Also try setting the stop bits =2 and experiment with the different parity’s or data bits.

These are the typical settings that I usually use.
DATA FORMAT- ISO
PARITY- EVEN
DATA BITS- 7
STOP BITS- 2
FLOW CONTROL- XON/XOFF

Stevo
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-28-2011, 05:22 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by stevo1 View Post
Yes Bill you are correct. I was just going from memory last night with no reference material. My book states that it is usually the FIFO buffers on the PC. This is a very common problem on the 10 and 11 series fanucs

The other 2 things that my book says is the program could be missing the O or : at the beginning of the program number. Also try setting the stop bits =2 and experiment with the different parity’s or data bits.

These are the typical settings that I usually use.
DATA FORMAT- ISO
PARITY- EVEN
DATA BITS- 7
STOP BITS- 2
FLOW CONTROL- XON/XOFF

Stevo
Hi Stevo,
Your answer highlights why more detail than just a generic error condition should be provided by OPs so that definitive solutions can be provided. Unless there is a physical problem with the control's IO board, its rather hard to get communication with a Fanuc control wrong if you follow the simple steps required to set the control and PC correctly. With the lack of information that is often provided, it becomes a matter of randomly changing stuff until a resolve is stumbled upon.

Like they say, if you put enough chimps in a room with word processors, eventually you'll get the complete work of William Shakespeare.

Regards,

Bill

.
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
Problem- Haas chokes on my custom G code Vern Smith Haas Lathes 3 11-20-2009 12:15 PM
Writing a custom M code? greeder88 Dynapath 1 06-24-2009 08:52 AM
Need Help!- inserting custom code beartrax Mastercam 3 08-29-2008 10:53 AM
Custom bending a custom extrusion brokenrinker Bending, Forging,Extrusion... 10 12-15-2007 08:28 AM
Is there any G-code for custom using? david_geng G-Code Programing 3 02-11-2007 08:56 AM




All times are GMT -5. The time now is 07:27 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