![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Parametric Programing (custom macro b, fadal macro, okuma user task) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I've looked in the Fanuc manual and in Peter Smid's book for Fanuc Macro B programming, but can't find an example. Both say that the output value is 1 if true, and 0 if false. Not much help. I have to assume these values aren't stored anywhere, or one of the books would have mentioned that little fact. Can I use AND in IF[...AND...]GOTO or IF[,,,AND...]THEN type of statements? Thanks. |
|
#2
| |||
| |||
| You would use this for checking multiple values. IF[#100EQ.9999]AND[#101EQ.8888]GOTO1234 If BOTH values are as stated then and only then will it jump to N1234. If they do NOT both equal those values then it will advance to the next line of code. Not all controls will allow this feature even though macro is available. |
|
#3
| |||
| |||
Will take a bit longer to finish my Macro subroutine, as it is a bit involved. At least for me. What is done was written while I was on vacation. Will try to post my results once finished. |
|
#4
| |||
| |||
| Some additional info, you should be able to nest to at least 4 sets of brackets on fanuc and probably the rest as well. IF [#100EQ.9999]AND[[#101EQ.8888]OR[#101EQ#[#105]]] GOTO1234 Just added an OR, and random variable usage on the lase EQ statement to show 3 deep nesting. |
|
#5
| |||
| |||
I will give your example a try, but this is what I got from the Fanuc tech. In Macro B, the AND/OR/XOR statements are bitwise operators, used as one would a math function, such as: #1=#2 AND 8; and this They actually do it bit by bit. I will show this as 8 bit binary data: #2=155 or 10011011 8 would be 00001000 ANDing them together would give 00001000 I dropped the decimal point as floating point math and bitwise operations don't mix well |
| Sponsored Links |
|
#6
| |||
| |||
| Yes, the statement will distill down to a bitwise and/or line IF [#100EQ.9999]AND[[#101EQ.8888]OR[#101EQ#[#105]]] GOTO1234 IF [1]AND[[0]or[1]] goto 1234 IF [1] goto 1234 But it is only one bit 0 or 1 (meaning yes or no for each comparison) unless you do something weird. |
|
#7
| |||
| |||
| AND, OR and XOR can be used as logical functions also depending on a parameter setting. On Fanuc 0i series, 6006#0 should be 1, otherwise only bitwise operation would be possible. On other controls, parameter number might be different. |
![]() |
| 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 |
| tl-2 program integrity error and program data error alarm #'s 212 250 need help | CNChelp | Haas Mills | 12 | 03-14-2010 09:19 PM |
| Mazatrol Program into a G Code Program | fuzzman | Mazak, Mitsubishi, Mazatrol | 14 | 02-08-2010 04:55 PM |
| Where should PROGRAM ZERO be? | max90272 | General CAM Discussion | 5 | 02-19-2009 12:29 AM |
| Program Restart in mid program? | Donkey Hotey | Haas Lathes | 16 | 03-18-2008 03:19 PM |
| Anyone got any basic examples of a program using a subroutine/program? | Darc | CamSoft Products | 11 | 10-09-2005 12:45 AM |