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  
Old 03-17-2010, 01:27 PM
 
Join Date: Sep 2009
Location: Europe
Posts: 8
aidoru is on a distinguished road
Change variable by MDI

Hello,
I would like to know how it is possible to change a variable by MDI;
for example:

N100 print "variable #1 is equal to?" --> this msg can be read on the screen
The operator insert "250"
And so now #1 is = 250.

A sort of "scanf" or "cin" for fanuc

Thank you very much
Reply With Quote

  #2   Ban this user!
Old 03-17-2010, 10:26 PM
CNCRim's Avatar  
Join Date: Feb 2006
Location: usa
Posts: 947
CNCRim is on a distinguished road

just type in whatever the variable you wish, #1=33 input then start. it should show up as 33 under variable #1
__________________
The best way to learn is trial error.
Reply With Quote

  #3   Ban this user!
Old 03-18-2010, 07:33 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Audoru...CNCrim is correct you just go into MDI and type #1=250->EOB->INSERT->cycle start. Now #1=250. One thing to keep in mind on the Fanuc controls #1-#33 are your local variables and will clear to null if you press reset or at program end with M30.

What model Fanuc are you using?

Stevo
Reply With Quote

  #4  
Old 03-18-2010, 01:01 PM
 
Join Date: Sep 2009
Location: Europe
Posts: 8
aidoru is on a distinguished road

Thank you,
but it's possibile that i didn't explain it well enough:
I know that i can set a variable by mdi, but the problem is that i would like a sort of M00 with condition....
For example:
i have a program in execution and i want on block N100 a sort of:
print "set you variable to 1 or 0"
and put the 1 or 0 inserted by operator by mdi into a variable, and then if #my_variable it's equal to 1 the program can continue, else the program will stop by an M30.
Reply With Quote

  #5   Ban this user!
Old 03-18-2010, 02:24 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Hmmm ok I am a bit more clear on what you are looking to do but not quite 100%. First off you cannot have the program stop to display what the value of #1 is equal to. You can have the program stop and have the operator view it through the settings screen. You can also have him change it through the settings screen by pressing 1 or 0 then “input”.

Now with that being said you can have the program stop with a M0 and have the operator input the proper number (1 or 0) into #1 then continue the program. Now you can write the code to have the program end with M30 or continue machining based on what #1 is set to. I believe this is what you were trying to explain.

Now in the code below the operator will enter what he needs into #1 when the M0 is read, either 1 or 0. The program will continue and when it reads the "IF" statment and if #1 is set to 1 it will skip the M30 and go to the N100 and continue machining. On the other hand if #1 is set to 0 it will not go to N100. It will just proceed to the next block which is M30 and the program will end.


M0
(INSERT 1 OR 0 IN #1)


IF[#1EQ1]GOTON100
M30
N100(CONTINUE MACHINING)


Stevo
Reply With Quote

Sponsored Links
  #6  
Old 03-18-2010, 04:53 PM
 
Join Date: Sep 2009
Location: Europe
Posts: 8
aidoru is on a distinguished road

Thank you very much Stevo,
last ( I hope ) question is:
between M0 and if condition how is possibile to save the number that operator enter into variable #1?
What is the command that i have to insert into the program to set this variable as the operator want?

Thank you
Reply With Quote

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

Ask all the questions that you want to. That’s what we are all here for.

You can very easily save this value that is input into #1. As a quick reference #1-#33 are your local variables and will clear to null at reset or program end. #100-#199 are you common variables and will clear only at power down of the machine depending on if you have a parameter to allow or disallow them to clear. However it is most common they clear at power down. #500-#999 are you permanent common variables which will never clear unless you program them to change or clear.

So you can save what #1 is set to by writing it like below. Use #100-#199 if you don’t care that the value will clear at power down, or use #500-#999 if you don’t want the value to clear at all. Make sure that the variable you choose is not being used for something else. These are commonly used for tool changes or macros.


M0
(INSERT 1 OR 0 IN #1)
#500=#1

IF[#1EQ1]GOTON100
M30
N100(CONTINUE MACHINING)


What exactly are you trying to do? I am just wondering if there is a easier or less operator interface way of doing what you need done. You can have conditions before hand that can maybe set #1 so the operator does not have to and the program will machine accordingly. You may also want to change #1 to #100 or #500 as long as those variables are not being used for something else.

Stevo
Reply With Quote

  #8   Ban this user!
Old 03-19-2010, 04:30 PM
 
Join Date: May 2007
Location: US
Posts: 779
Andre' B is on a distinguished road

If you are wanting what I think you are, just use the block skip.

.
.
.
M0(BLOCK SKIP OFF TO STOP);
\GOTO9999;
.
.
.
N9999
(CODE TO TURN STUFF OFF AND PARK THE MACHINE WHERE YOU WANT IT)
M30
Reply With Quote

  #9   Ban this user!
Old 03-20-2010, 05:12 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

If you are using MDI programs too often, you may find the following information useful:

The default setting for the MDI mode is such that the program gets erased automatically, after its execution is complete. This means that the program would require to be typed again, for a subsequent execution. This makes trial and error impractical in MDI mode. However, if parameter 3204#6 (on 0i control) is set to 1, the MDI program is retained even after its execution is over. The RESET key will, of course, erase it. If it is desired to retain it even after pressing RESET key, set parameter 3203#7 to 0. An MDI program, however, cannot be permanently saved with a program number, for a future use. Switching off the machine erases it permanently.
Reply With Quote

  #10   Ban this user!
Old 03-20-2010, 05:25 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road
MDI warning

I once squashed a job with the spindle nose on an Acramatic by accidently starting an MDI program instead of MEM program. Both screens looked virtually identical. I therefore prefer MDI to clear after performing required action...

DP
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 03-20-2010, 06:58 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Can you execute an MDI program in AUTO mode?
(I am not sure)
Reply With Quote

  #12   Ban this user!
Old 03-20-2010, 05:42 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

Originally Posted by sinha_nsit View Post
Can you execute an MDI program in AUTO mode?
(I am not sure)


No, but you can do what I did and forget which mode you are in. The control I was using was virtually all touch-screen, no mode setting dial or switch, and the display barely changed from MEM to MDI.

As I recall, on Acramatic you could write your entire program in MDI, re-run it and ultimately save it. My MDI program was simply a move to XY-zero then down to clock location boss on fixture. It was never meant to be run with a component sitting in the way....

DP
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
EMC2 variable pitch / variable diameter threading. samco General Metalwork Discussion 0 03-09-2008 01:40 PM
variable to change tool offsets in auto cycle dalvinder Machine Problems, Solutions , Wireless DNC, serial port 0 09-04-2007 03:45 PM
How to change Tool change position(About MAZATROL T1 control) liushuixingyun Mazak, Mitsubishi, Mazatrol 5 07-07-2007 02:58 PM
variable speed dial reconnection, or drive belt change? klysons Tree 1 06-29-2007 09:30 PM
IF variable = bla THEN do this ELSE do that ? iMisspell G-Code Programing 21 07-30-2006 10:57 PM




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