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 09-21-2009, 05:42 PM
idtkid's Avatar  
Join Date: Feb 2007
Location: US
Age: 25
Posts: 167
idtkid is on a distinguished road
Where is the syntax error in this Fanuc code?

Bear with me, I am very new to using industrial machines so im sure my error is very obvious.

Pasted below is the beginning part of my ~2000 line program, upon trying to run this in single block mode I get a syntax error, can you spot it?
(RhinoCAM posted this code, my Fanuc 21m controller adds a semicolon character at the end of each line)

O0001
%
N0005G0 G91 Z0
N0010G0 G90 G17 G20 G40 G80 G90 G94 G64
N0015G0 G90 G54 X0 Y0
(2 1/2 Axis Facing)
N0020 T3 M6
N0025 M8
N0030 G90 G1 X-0.8875 Y0.6125 F200. S5000 M3
N0035 G90 G43 Z0.25 H0
N0040 Z-0.0625 F60.
N0045 Y2.75
N0050 X-0.8753 Y2.8744
N0055 X-0.839 Y2.994
N0060 X-0.7801 Y3.1042
N0065 X-0.7008 Y3.2008
N0070 X-0.6042 Y3.2801
N0075 X-0.494 Y3.339
N0080 X-0.3744 Y3.3753
N0085 X-0.25 Y3.3875
N0090 X3.25
__________________
Rockcliff PE/Aluminum Router > 4'x8' CNC Router/Plasma > Manual DRO/CNC X2 > 4 Axis Syil SX3 and an Emco PC Mill 125
Reply With Quote

  #2   Ban this user!
Old 09-21-2009, 06:02 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

What is the alarm number?
Reply With Quote

  #3   Ban this user!
Old 09-21-2009, 06:04 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

Could be the H0. I would guess it should be H3.
Reply With Quote

  #4   Ban this user!
Old 09-21-2009, 06:05 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

I would also think you want N0005 to be G0 G91 G28 Z0 to take Z up to it's home position.
Reply With Quote

  #5   Ban this user!
Old 09-21-2009, 06:19 PM
idtkid's Avatar  
Join Date: Feb 2007
Location: US
Age: 25
Posts: 167
idtkid is on a distinguished road

Error is: 9 N 0 SYNTAX ERROR (i have changed H0 to H3, what does this do?)
__________________
Rockcliff PE/Aluminum Router > 4'x8' CNC Router/Plasma > Manual DRO/CNC X2 > 4 Axis Syil SX3 and an Emco PC Mill 125
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 09-21-2009, 06:43 PM
 
Join Date: Feb 2006
Location: United States
Posts: 273
dpuch is on a distinguished road

Originally Posted by idtkid View Post
Error is: 9 N 0 SYNTAX ERROR (i have changed H0 to H3, what does this do?)
G43 H# activates the tool length offset for tool # in this case tool 3
dcoupar's other comment looks like a good change as well.

Which line is it stopping on? You should be able to look at the line after the error pops up. If you have a problem with that, try using single block until you get the error. That should narrow it down greatly.

Edit: Doh, your second line is % that usually marks the beginning and end of a g-code file.
Reply With Quote

  #7   Ban this user!
Old 09-21-2009, 06:47 PM
MysticMonkey's Avatar  
Join Date: Mar 2009
Location: Australia
Posts: 366
MysticMonkey is on a distinguished road

EOB goes before the comment




Last edited by MysticMonkey; 09-21-2009 at 07:10 PM.
Reply With Quote

  #8   Ban this user!
Old 09-21-2009, 07:20 PM
 
Join Date: Apr 2007
Location: Canada
Posts: 3
kazikw is on a distinguished road

First what I see isunnormal lookig line NG90G43Z0.25HO
I think firs should be H value than Z value.
Tray this way NG90G43H3Z0.25
If not work let me know
Reply With Quote

  #9   Ban this user!
Old 09-21-2009, 08:22 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,555
Superman is on a distinguished road
Buy me a Beer?

O0001
%
N0005G0 G91 Z0
The % is not part of NC language

it is used with communication software for start and end of transmission

This is the only source for the syntax error. It is to be the only code on #1 line ( some controls use it at the end of the filename string on the 1st line--Okuma's ) or deleted, it should also be the last character in the file

All other items mentioned will not cause the machine to not cycle start
Reply With Quote

  #10   Ban this user!
Old 09-22-2009, 01:13 AM
MysticMonkey's Avatar  
Join Date: Mar 2009
Location: Australia
Posts: 366
MysticMonkey is on a distinguished road

Sorry to nitpick

But having % mid way through the program doesn't cause the Syntax error.

Not having the program number after the % at the beginning of the program will cause an error.

When the data is sent over RS232 it uses the O program number after the % to name it's self.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 09-22-2009, 03:12 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

H0 cancels the tool length compensation, like G49.

Like many others, I am not comfortable with % sign. Remove it and run the program in single block to find out where exactly it alarms out.
Reply With Quote

  #12   Ban this user!
Old 09-22-2009, 01:20 PM
 
Join Date: Feb 2006
Location: United States
Posts: 273
dpuch is on a distinguished road

Originally Posted by MysticMonkey View Post
Sorry to nitpick

But having % mid way through the program doesn't cause the Syntax error.

Not having the program number after the % at the beginning of the program will cause an error.

When the data is sent over RS232 it uses the O program number after the % to name it's self.
Actually on our machines 15,16, 16i They all default to O0000 if there isn't a program number, but that may be a parameter option. Anyhow it's almost certain the % should not be there. A question is it there in the file, or somehow on the control? And again which line is it stopping on in single block.
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
Auto Tool Zero VBA Code gives Syntax Error kiltjim Mach Wizards, Macros, & Addons 2 02-02-2009 05:32 PM
Need Help!- Fanuc Error code Racecarengineer General CNC (Mill and Lathe) Control Software (NC) 1 06-12-2008 12:46 PM
Fanuc 10M Error Code WallStreet General CNC (Mill and Lathe) Control Software (NC) 1 10-12-2007 03:41 PM
Error code help on Fanuc digger1969 Fanuc 8 03-29-2007 04:38 AM
syntax error pyroracing85 G-Code Programing 9 01-27-2005 07:09 PM




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