![]() | |
| 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
| |||
| |||
The book by Peter Smid on Fanuc Macro uses statements like #5 = [#1 EQ #2] on page 125. This,however, gives MACRO FORMAT ERROR on my 0i Mate TC. Is there a parameter which can be used for allowing such statements (assigning 1 for TRUE and 0 for FALSE)? Or, is Peter Smid wrong? |
|
#3
| |||
| |||
| Sinha, I have never seen a macro statement like that before. I have not read Peter’s book so I don’t know what he is trying to refer to in that statement. When using the EQ, LE, GE, statements this is usually to go to certain area’s in the program or to set a certain number. Example IF[#1EQ#2]GOTO100 G0G28Z0 N100M30 In this statement if variable #1 was equal to variable #2 then the program would jump to N100 line and end the program with the M30. However if variable #1 was NOT equal to #2 then the program would go to the next line of G0G28Z0 then end the program with M30. Or you can use the format of IF[#1EQ#2]TH#5=10. This will set #5=10 if #1 is the same as #2. If it is not then nothing will change with #5. #5=[#1EQ#2] is not a proper format of a macro for a Fanuc control that is why you are getting the alarm. The only thing that I can think is maybe the EQ is suppose to be a +. Then #5 would be set to the sum of #1+#2. Chetan, The G65 is a macro “call” not a function that you turn on and off to use the variables. The G65 is a way of passing data to your local variables. For example a few of the local variable assignment is A=#1, B=#2, C=#3, D=#7. So if you wanted to write a statement using your macro call you would format it like this. O0001(main program) G65P8000A5B10D4C35 M30 What this code will do is call program 8000 just like a sub program using M98 except #1 would equal 5, #2=10, #3=35, #7=4. You then write your 8000 program using these variables. O8000 G0G90X#1Y#2Z#7 G1Z-#3 G0Z#7 M99 Stevo |
|
#5
| |||
| |||
. Can you explain what that means? So when something is false it is =1. and if something is true it is =0. I don't follow you. I do extensive macros and I have never even seen that in the Pascal format. Am I missing something or misunderstanding what your saying?Stevo |
| Sponsored Links |
|
#6
| ||||
| ||||
| sinha_nsit post Peter’s book page 125 #5 = [#1 EQ #2] on fanuc is a MACRO FORMAT ERROR see stevo1 example for corect format stevo1 other use of G65 on Fanuc with Macro A G65 H81 P1000 Q#101 R#102 ( IF[#101EQ#102]GOTO1000 ) |
|
#7
| |||
| |||
Boolean and Binary Examples As an exercise, evaluate the following macro data entries. The first group is the given data, the second group is the evaluated data, and the final third group is the compared data. Given data: #1 = 100.0 Stored value is 100.0 #2 = #0 No data - variable is VACANT #3 = 100.0 Stored value is 100.0 #4 = 150.0 Stored value is 150.0 Evaluated data: #5 = [#1 EQ #2] Returns 0 = FALSE #6 = [#2 EQ #3] Returns 0 = FALSE #7 = [#2 EQ #0] Returns 1 = TRUE #8 = [#1 EQ #3] Returns 1 = TRUE #9 = [#4 GT #3] Returns 1 = TRUE Compared data #10 = [[#1 EQ #3] AND [#2 EQ #0]] TRUE, because both values are true etc. My observations: What he writes on the right-hand side of = is OK, but TRUE or FALSE values cannot be assigned to variables which can only store arithmetic values. Smid believes that when TRUE is assigned to a variable, the variable stores 1. Similarly, assigning FALSE to a variable makes the variable store 0. At least on my machine, with the current parameter setting, this gives MACRO FORMAT ERROR (alarm no 114). I could not find any parameter in the parameter manual for such an interpretation of TRUE and FALSE. TRUE and FALSE are boolean values, and cannot be mixed up with arithmetic values. |
|
#8
| |||
| |||
You are saying that is different.There are two types of macro body A type and Btype . what i mean to say is just see below N0....start of the program . . G65 H02 P#100 Q#100 R1 ( this balock will add 1 input in the variable #100) G65 H82 P0 Q#100 R10 ( this block will see that variable #100 is equal to 10 or not if it is not equal then it will go to N0 if it is equal then it will go to next block) G65 H01 P#100 Q0 ( in this variable #100 is made equal to zero) M30 (end of the program) The above sample i had used for running the program 10 times i.e. for 10 jobs. H02 is for addition H01 is for equal H82 is for conditional divergence. This works 100% Last edited by chetan; 02-21-2009 at 02:17 AM. |
|
#9
| ||||
| ||||
| I am not saying that you are incorrect with your programming that you gave in your last post. I would assume that you are using macroA? However with your post you made here you made it sound like you need to activate G65 in order to use the line of code Sinha_nist originally posted "#5 = [#1 EQ #2] page125". You can use variables or calculation lines anytime in a main or sub program not needing to use G65 at all. Stevo |
|
#10
| |||
| |||
| My machine has Macro B. The book also claims to have been written for "Fanuc Custom Macro B users". Are you people aware of any other book on Macro B, which describes it in detail, not just as a 10-page Chapter in a conventional programming book? I have heard about Mike Lynch's book, but it is too expensive, above $90. Mike Lynch is a big name, but I have no idea about his book. Any comment from you? Any other good book? |
| Sponsored Links |
|
#11
| |||
| |||
I think you you should use common variables instead of local variables. I dont know much about this, it is just suggestion. Infact i need to know is there any diff bet them. |
|
#12
| |||
| |||
| If you have used some programming language such as Pascal, it would be easy to understand. Local variables are same as local variables of a Fortran subroutine (called Procedure in Pascal). Common variables are global variables which can be use everywhere with the same meaning. |
![]() |
| 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 |
| Boolean Operation with a Mesh | chaddcurtis | Rhino 3D | 10 | 02-22-2011 02:08 PM |
| Macro Syntex Error??? | jamesweed | Fanuc | 5 | 02-20-2009 01:02 AM |
| Need Help!- V22 Boolean Subtract | TZ250 | BobCad-Cam | 12 | 12-03-2008 01:11 AM |
| Boolean | camtd | SolidEdge | 0 | 09-21-2008 06:31 PM |
| Boolean Feature | svenakela | SolidEdge | 2 | 08-27-2007 09:18 PM |