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 03-22-2010, 09:37 PM
 
Join Date: Dec 2008
Location: USA
Posts: 5
golfindick is on a distinguished road
Can I get the status of relay in a program?

Is it possible to get the status of a relay (on/off) in the ladder from within a subprogram or a macro? I have a custom M-code that turns on a certain relay under certain conditions and need to have the ability to check the status of that relay from within a program or macro. Maybe by using an IF- statement or something of that nature?

Thanks,
Steve
Reply With Quote

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

I would think if you have a custom code to activate the relay then you should be able to check the status of it. But it will depend.

What kind of Fanuc control are you using? Does the custom code run a program or does it activate the relay via ladder?

Stevo
Reply With Quote

  #3   Ban this user!
Old 03-23-2010, 11:47 AM
 
Join Date: Dec 2008
Location: USA
Posts: 5
golfindick is on a distinguished road

Control is Fanuc 21i-T. It is just an m-code that turns on a relay with the ladder logic. I need to be able to check the status of that relay from either the main program or a macro / subprogram.
Reply With Quote

  #4   Ban this user!
Old 03-23-2010, 01:50 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Ahhhh man I just typed up a whole page of what to do and now just realized that it will not work. I need more info. First off is the M-code tied to an input/output system variable? You should be able to find that info in the MTB manual. Is there an M-code to deactivate the relay opposite of the M-code you use to activate it?

What exactly is this M-code used for? IOW what are you activating, what conditions must be met, and why?

Stevo
Reply With Quote

  #5  
Old 03-23-2010, 02:25 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

Wouldn't the system variables that read D1/D0 from #1000 I believe, do the trick?
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-23-2010, 03:59 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Yes Al you are correct that is what I originally started typing up before. He will have to see if any of them are tied to the M-code he is using. I would ass u me that one of them are.

What I originally started typing up:
If your M-code to turn on the relay is tied to an input/output signal then there should be a system variable attached to it. IIRC they should be the same for your control. #1000-#1035 are input signals corresponding to UI000-UI031. #1100-#1135 are the output signals corresponding to UO000-UO001.

Stevo
Reply With Quote

  #7   Ban this user!
Old 03-23-2010, 07:55 PM
 
Join Date: Dec 2008
Location: USA
Posts: 5
golfindick is on a distinguished road

I will start at the beginning. We have a high volume production shop with about 55 miyano's. Actually I'm going to modify the ladder so that when an operator opens the chuck with the foot pedal it will turn on a relay (internal or a physical output), I have an m-code that will turn it off when needed. We drill and then ream a hole in the center of the part. Operators have to check the drill size numerous times a day. We use M1 as an optional stop so when the operator needs to check the drill size they just turn on the M01 button. They are supposed to check the drill size with the part in the chuck and just hit cycle start and go. Unfortunately sometimes they take it out and replace it with a raw blank (non drilled) part and start up the program (without resetting it). A reamer doesnt fair well without first having a drilled hole to follow, causing a crash and the loss of a $300 reamer.I would like to call a macro after the M1 line in the program, the macro would use an IF statement to check the status of the relay to see if the chuck was opened, if so then it would zero return the machine and reset the program resulting in no crash and saving me lots of money. I can modify ladder programs but have little experience with looking up system variables or anything of that nature in the main program. If I can look up a system variable that had a given "D" address then that would be fine. I just dont know what commands to use or what system variable corresponds with what relays or "D" address from the ladder. Thanks for any input you guys have.....
Reply With Quote

  #8   Ban this user!
Old 03-23-2010, 08:44 PM
 
Join Date: Oct 2003
Location: TEXAS
Posts: 41
n174k is on a distinguished road

Do it all in ladder:


Inhibit Chuck Open:

Cycle start sets an R flag=1
R flag=1 inhibits chuck open


Enable Chuck Open:

Call Custom Defined Mcode at end of program sets R flag=0
MDI Custom Defined Mcode to set R flag=0
Optional - Reset logic to set R flag=0

Del
Reply With Quote

  #9   Ban this user!
Old 03-24-2010, 04:51 AM
 
Join Date: Aug 2008
Location: UNITED STATES
Posts: 97
CHAD LAWSON is on a distinguished road

the program can both read and write to the ladder using the #1000 to read and the #1100 series to write conditions to the ladder. an example is if you would like to read say the skip signal x4.7 you would put this input to a G54 or G55 bit 0-7 coil in that ladder at this point you can monitor the input signal. Some machines have some addresses preassigned to these coils. Check your ladder for any G54 or G55 coils. If not then this can be done with a very simple ladder edit. I some automated machines in the shop that have complex ladders and programs where they talk between each other. If you need any help with ladder edit I could help as i have written several ladders. Oh and the read variables start at #1000=G54.0 #1001=G54.1 then progress untill you get to g54.7. The write ones are an F address but i would have to double check before telling you as i don't use these much
Reply With Quote

  #10   Ban this user!
Old 03-24-2010, 07:33 AM
 
Join Date: Dec 2008
Location: USA
Posts: 5
golfindick is on a distinguished road

After checking, I have open coils in the ladder that have nothing assigned to them, starting at G055.2 through G055.7. I could essentially turn one of these on (and latch it on) if the chuck has been opened and use a spare M-Code to just turn it off. Then inside a macro I could use and IF statement to check the status of that coil? The problem I have is I know very little about Fanuc controls and the language used in them to access these coils. I can do normal programming for the CNC and modify the ladder, just no experience with custom macros with Fanuc. What is the difference between the G coils and D coils? Can you check the status of both types or just the G? Thanks you guys are a great source of knowledge...
Reply With Quote

Sponsored Links
  #11  
Old 03-24-2010, 09:12 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

G registers in the ladder are registers for the PMC to communicate with the CNC side via the BMI, (Basic Machine Interface), G are sent to the CNC side from PMC, F are sent from CNC to PMC.
R are internal general purpose registers.
The G & F have pre-asigned functions as spelt out in the connection (BMI) manual.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #12   Ban this user!
Old 03-24-2010, 09:44 AM
 
Join Date: Aug 2008
Location: UNITED STATES
Posts: 97
CHAD LAWSON is on a distinguished road

yes you could use these addresses. But you would have to asign an input rather internal in the ladder with an R address or an external x address to turn this coil on or off. Never make any ladder edits with out verifying everything several times. As for the macro programming one thing about Fanuc is they give you everything you need but don't tell you how to use it for your application. If you have or can get the PLC programming manual and the macro programming manuals its all there. As for the language you will be looking for if say G54.0 is #1100 variable in your program if #1100=1 it is high and is turned on if #1100=0 it is not. So you can in one line check the status and then set your conditions whether it be jump to the next line or set up a custom macro alarm. Some of these alarms set the machine to Feed hold and some can e-stop the machine. you have to decide how to proceed from there.
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
Using a solid state relay as a main stop relay garagefela General Electronics Discussion 4 02-26-2010 04:27 PM
How to monitor pin status? DustToDust LinuxCNC (formerly EMC2) 1 09-18-2009 11:23 AM
Need Help!- status bar mx3 fenix728 Mastercam 6 03-25-2009 09:06 PM
status bar miltonmorales Mastercam 8 02-04-2008 03:56 PM
What is the status of the new 3016FX? ltmquik Fadal 0 04-10-2007 12:08 PM




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