![]() | |
| 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
| |||
| |||
We are using Custom Macro B extensively on a CNC lathe. When trying to change the sign of a variable from positive to negative, we seem to only be able to change it using a two line formula. In the example below, we are trying to change variable #527 to a negative value. I would like to do it on one line, but either MacroB doesn't follow all algebraic rules or my algebra just plain sucks (and that may very well be the case). The fact that we can't use parenthesis doesn't help either, since the control ignores it like any comment in the code. #6=#527-.12 #6=-#6 I've tried things like #6=[-]#527-.12 and #6=[[#527*-1]-.12] Any suggestions from the sharp folks on here? |
|
#2
| ||||
| ||||
| As far as I understand it, 1-33 are reserved for argument transfers from the G65 macro call line to the macro. I'd use either the common variables 100-199 (which reset to null on power off/on cycle) or 500-599 (which stay put when powered is cycled). #100=-[#6] of course, you could try #6=-[#6], but i wouldn't because I don't like using those variables as a matter of personal taste. |
|
#5
| |||
| |||
| What number is #527 usually set to? Are you trying to get a negative value for the result of #527-.12? Where is #6 playing a factor into your calculation? There is a few ways to do this. If the value of #527 is normally greater than .12 you can reverse the calculation. Ex #527 is set to .7 #6=.12-#527=-.58 I guess you didn’t need all of that but anyway if you want #527 set to a negative value program #527=[-#527]. This works on all of my Fanuc’s. Or you can use as Beege has formatted #527=-[#527] Beege, FYI….you can use #1-#33 anytime that you want. You don’t have to use them exclusively as a passing of variables with the G65 command. Stevo |
| Sponsored Links |
|
#7
| ||||
| ||||
|
Yup, knew it; just don't as "a matter of personal taste". Thanks for the reaffirmation. |
|
#8
| |||
| |||
| Perkulator, Jmeckes never told us what control he was using. Now this could depend on what control he is using but none of my 15 series Fanucs support #527=[#527*-1] it is an improper format. I am assuming that he is using a Fanuc and this statement will not work. However I have seen this format in other threads so it must work on different controls. Beege, I am just opposite. I like to use the #1-#33 just for the fact they clear at reset or program end. No chance for opps forgot to set it to 5 in the second program when it was used as 1 before that. I also like the fact that if I want to go 2 subs deep I can use them again in the second program set to a different number and they return to the previous value when coming back to the 1st sub. As you know with macros there is dozens of ways to approach it. No 1 way is right or wrong. Stevo |
|
#9
| |||
| |||
| It's a 21i on a sub-spindle lathe. We are using it to control the depth of a drill at the end of a peck cycle. That's where the - comes in. The positive values used for the sub were no problem for the calculation. We ended up using Kiwi's formula, but both that one and Chattaman worked for what we needed. Thanks all! |
|
#10
| |||
| |||
| Why bother with the math? so to speak.... Just say... -#527 But without knowing what the conditions are... Are you trying to use #527 as a negative function? -#527 or you just simply want to insert a negative value in #527? #527=-#527
__________________ It's just a part..... cutter still goes round and round.... |
| Sponsored Links |
|
#11
| |||
| |||
| The program is variable loaded so I was trying to simplify and reduce program size. By keeping the sign change on one line of code instead of two, we are able to greatly reduce the size of the program. This also helps when it comes to training employees who are new to parametric programming. We've found that loading a control with a series of "variable" programs and having the operators copy and merge these mini programs is much less time consuming than using CAM software, and definitely more efficient than writing line by line G code. For almost everything we do now, we just have to input numbers without writing the entire program. |
![]() |
| 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 |
| Need Help!- Carving Signs | Sam A | BobCad-Cam | 2 | 05-04-2008 10:01 PM |
| Painting wooden signs? | abomb55076 | WoodWorking | 26 | 08-07-2007 11:39 PM |
| RFQ Billet superman signs | clarq_kent | Employment Opportunity | 21 | 05-26-2007 12:40 PM |
| wood signs | Pugster | WoodWorking | 1 | 07-08-2006 12:21 AM |
| Top Ten Signs | wms | CNCzone Club House | 19 | 06-21-2003 08:04 PM |