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 12-06-2010, 10:58 AM
 
Join Date: Apr 2007
Location: Thailand
Posts: 9
ixoxi999 is on a distinguished road
Fanuc custom Macro Question????

The following is my Custom Macro program of my Takeda Drilling Center Fanuc 10m:

O9000(ATC CUSTOM MACRO)
#3003=1
IF[#1012EQ1]GOTO8
IF[#1013EQ1]GOTO8
IF[#1014EQ1]GOTO8
#101=#4003
#102=#4002
IF[#500NE0]GOTO1
WHILE[#1015EQ1]DO1
#3000=1(TOOL CLAMP ALARM)
END1
IF[#149NE0]GOTO1
#3000=2(T CODE ERROR/T0...T0)
N1IF[#500NE#149]GOTO2
#3003=0

M99
N2G80G49G40
IF[#149LE36]GOTO3
#3000=3(T CODE OVER DATA)
N3
IF[#1015NE0]GOTO4
T1
M90
M19
T2
N4G91G28Z0
T1
M19
IF[#500EQ0]GOTO5
G53G90G00X#[#500+500]Y0
G23
G53Z-95.45Y80.0
G53Y150.2
M91
#500=#149
#1=BCD[#149]
#1132=#1132OR63
#1132=#1132AND#1
#1115=1
G91G28Z0M92
IF[#149GT0]GOTO6
G28Y0M93
T2
G22
G#101
G#102
G61
#3003=0
#1115=0

M99
N5G91G28Y0
N6G23
G53G90G00X#[#149+500]Y150.2
T1
M91
N7G53Y150.2
G53Z-80.0M92
G53Z-95.45
M93
M90
G53Y80.0
T2
#500=#149
#1=BCD[#149]
#1132=#1132OR63
#1132=#1132AND#1
#1115=1
G91G28Z0Y0
G22
G#101
G#102
G61
N8#3003=0
#1115=0

M99

The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head.

If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically.

My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable".

In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except,
"moving x-axis"
IF[#500EQ0]GOTO5
G53G90G00X#[#500+500]Y0
The program don't know the value of #500 Variable.
N6G23
G53G90G00X#[#149+500]Y150.2
The program don't know where to collect the value of #149 Variable. I think this is the tool number.

I don't know this Macro Program is Macro B or not.
What can I do to excecute the x-axis moving to the right position to get the tooling.

Thanks guy for your help.

Last edited by ixoxi999; 12-06-2010 at 11:29 AM.
Reply With Quote

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

Set bit number 5 of parameter 0319 to 1. This will allow single step of every macro statement and therefore enable you to check the value of the Macro variables and the flow of the program in single block.

Variable #500 is a Common variable that retains it's value when power off. Check the value of #500 before you try a tool change. I haven't checked the logic of the program thoroughly, but #500 may have had a value preset by the OEM, and if you cleared the memory and didn't record the value, then this may be part of your problem. #500 needs to have a value other than Zero to get past the first error trap.
Reply With Quote

  #3   Ban this user!
Old 12-07-2010, 08:48 AM
 
Join Date: Apr 2007
Location: Thailand
Posts: 9
ixoxi999 is on a distinguished road

Thank alot for your help man.
I can solve the problem.
Reply With Quote

  #4   Ban this user!
Old 12-07-2010, 10:52 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Null variables:
Except for EQ and NE, a null variable is treated as 0 in arithmetic and conditional expressions.
Reply With Quote

  #5   Ban this user!
Old 12-07-2010, 02:46 PM
 
Join Date: Jan 2009
Location: USA
Posts: 39
ggborgen is on a distinguished road
#1=BCD[#149]

Gentlemen,
In ixoxi999s macro it has this statement:
#1=BCD[#149]
My question is what is BCD? Thank You
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-07-2010, 11:28 PM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

BCD[_] changes its argument to BCD representation, interprets it in binary and outputs that value.
Let us say #149 contains 10 (in BCD[#149]).
BCD representation of 10 is 0001 0000.
The binary interpretation of 00010000 is 16.
So, 16 is output. Thus, BCD[10] = 16.

BCD and BIN functions are used in association with system variables for input/output interface signals.

For more information, read the attachment.

Sinha
Attached Files
File Type: pdf BIN BCD functions.pdf‎ (50.6 KB, 81 views)
Reply With Quote

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

Originally Posted by ixoxi999 View Post
Thank alot for your help man.
I can solve the problem.
So what was the solution to the problem?? It may help others with similar problems.

With a quick glance at your code it appears that #500 is to be set to the current tool that is in the spindle. With this being cleared it got mugged up on you. Was that the solution?

Stevo
Reply With Quote

  #8   Ban this user!
Old 12-07-2011, 05:21 AM
 
Join Date: Dec 2011
Location: việt nam
Posts: 1
triphataaa is on a distinguished road
Thumbs up Please observe the following macro

#500: the current tool in the spindle (1, 2, 3,...36)
#501: The position of the tool 1 (A)
#502: The position of the tool 2 (A+B); B:distance between two tool
#503: The position of the tool 3 (A+2B)
#504: The position of the tool 4 (A+3B)
...
...
#536:The position of the tool 36 (A+35B)
triphat-tp co., ltd; triphat.com@gmail.com

O9000(ATC CUSTOM MACRO)
#3003=1
IF[#1012EQ1]GOTO8
IF[#1013EQ1]GOTO8
IF[#1014EQ1]GOTO8
#101=#4003
#102=#4002
IF[#500NE0]GOTO1
WHILE[#1015EQ1]DO1
#3000=1(TOOL CLAMP ALARM)
END1
IF[#149NE0]GOTO1
#3000=2(T CODE ERROR/T0...T0)
N1IF[#500NE#149]GOTO2
#3003=0

M99
N2G80G49G40
IF[#149LE36]GOTO3
#3000=3(T CODE OVER DATA)
N3
IF[#1015NE0]GOTO4
T1
M90
M19
T2
N4G91G28Z0
T1
M19
IF[#500EQ0]GOTO5
G53G90G00X#[#500+500]Y0
G23
G53Z-95.45Y80.0
G53Y150.2
M91
#500=#149
#1=BCD[#149]
#1132=#1132OR63
#1132=#1132AND#1
#1115=1
G91G28Z0M92
IF[#149GT0]GOTO6
G28Y0M93
T2
G22
G#101
G#102
G61
#3003=0
#1115=0

M99
N5G91G28Y0
N6G23
G53G90G00X#[#149+500]Y150.2
T1
M91
N7G53Y150.2
G53Z-80.0M92
G53Z-95.45
M93
M90
G53Y80.0
T2
#500=#149
#1=BCD[#149]
#1132=#1132OR63
#1132=#1132AND#1
#1115=1
G91G28Z0Y0
G22
G#101
G#102
G61
N8#3003=0
#1115=0

M99

The tooling are placed along the x-axis. If I want to change the tool. The x-axis will move to the tool and clamp it into the spindle head.

If I want to change the tool, I command "Txx"(xx = tool number such as T01 is tool no. 1). And the program will excecute automatically.

My problem is I try to increase my memory by installing new ram into the motherboard. But I need to clear out all the memories including "Custom Macro Variable".

In the program, I can run it all, Clamp and Unclamp tooling and etc, the functions except,
"moving x-axis"
IF[#500EQ0]GOTO5
G53G90G00X#[#500+500]Y0
The program don't know the value of #500 Variable.
N6G23
G53G90G00X#[#149+500]Y150.2
The program don't know where to collect the value of #149 Variable. I think this is the tool number.

I don't know this Macro Program is Macro B or not.
What can I do to excecute the x-axis moving to the right position to get the tooling.

Thanks guy for your help.[/QUOTE]
Reply With Quote

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

Your program states that #500 is suppose to be the current tool in the spindle so set #500 via MDI equal to the current tool in the spindle.

#149 is probably being set via T() command thru a parameter setting which also calls program 9000. Make sure you have that parameter set. It is different depending on which model Fanuc control you are using. Since you did not tell us which control you are using we cannot tell you which parameter to set. You can also test this by programming a T() command and then checking parameter #149 and it should be set to your modal T().

FYI it is macroB that it is coded to.

It will also help in the future to start a new thread related to your problem instead of posting in one that is over a year old and not related at all to your issue.

Stevo
Reply With Quote

  #10   Ban this user!
Old 12-08-2011, 04:31 AM
fordav11's Avatar  
Join Date: Aug 2011
Location: Fordaville
Posts: 939
fordav11 is on a distinguished road

AND post that new thread in the Macro forum
Parametric Programing - CNCzone.com-The Largest Machinist Community on the net!
Reply With Quote

Sponsored Links
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 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 question sinha_nsit G-Code Programing 28 04-18-2009 06:44 AM
Fanuc 18i custom macro B djmcdaris Fanuc 17 03-10-2009 01:58 AM




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