![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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 |
|
#2
| |||
| |||
| 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 |
|
#4
| |||
| |||
| 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 |
|
#5
| ||||
| ||||
| 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. |
| Sponsored Links |
|
#6
| |||
| |||
| 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 |
|
#7
| |||
| |||
| 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..... |
|
#8
| |||
| |||
| 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 |
|
#9
| |||
| |||
| 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 |
|
#10
| |||
| |||
| 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... |
| Sponsored Links |
|
#11
| ||||
| ||||
| 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. |
|
#12
| |||
| |||
| 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. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |