What's new
What's new

macro question

jig grind dave

Plastic
Joined
Mar 5, 2015
hello, im new to macro programming and trying unsuccessfully, to get a simple "if-then" macro to work.
any helpful advice will be rewarded handsomely !!
im working on a jig grinder with a fanuc 180i mb control.
trying to adjust the feed at different intervals along the x axis utilizing variable #5041 (current position).
its not working.
it does not alarm out, it doesnt do anything.
im expressing the macro as follows at the beginning of the program.
if[#5041 is le xxxx] then f#xxxx
i have found, in the book, some narrative that may explain why it does not work, but not sure if this is the reason why, it does not work.
it states that "the read operation during movement is disabled" relative to variables #5041-#5048.
if this is the reason, can & how do i "enable" it, and will this affect anything else negatively ?
thank you all.
dave
 
The reason it is disabled is due to the servo lag in updating the control. If you read 5041 while it is moving, it is not at the actual *current position* it is at the position it *WAS* at when the control polled the servo, but that was up to several hundred milliseconds ago........and the machine is not at that position any longer because it is moving.

There is a macro sticky at the top of the forum, I believe it to be worth reading the whole thing. Lots of good info in that thread.
 
That expression is not in the correct format.

It should be "IF [#5041 LE 542.0] GOTO 200" Where 200 = N200

Block N200 would have the modified feed as the contents of the block.
 
ok, i got the if & goto statement to work in mdi, however, i dont think this is what i want. what im trying to accomplish is increasing the feedrate during voids in the material whilst cutting along in the x & y axis at the same time. the start and end points of the axis are currently expressed in one program line. my thought was that i must be able to somehow monitor the x & y positions as the machine is moving along and adjust the feedrate where & when i want without advancing to a different sequence number as the "if & goto" statement has to be expressed.hence my initial experiment with the "if & then" statement.
thanks
 
If you know the geometry, you can program your feedrates as per your choice. You can change it wherever you want, any number of times. No macro needed.
Looks like I have not understood the problem, because the solution cannot be so trivial!
 
ok, i got the if & goto statement to work in mdi, however, i dont think this is what i want. what im trying to accomplish is increasing the feedrate during voids in the material whilst cutting along in the x & y axis at the same time. the start and end points of the axis are currently expressed in one program line. my thought was that i must be able to somehow monitor the x & y positions as the machine is moving along and adjust the feedrate where & when i want without advancing to a different sequence number as the "if & goto" statement has to be expressed.hence my initial experiment with the "if & then" statement.
thanks

Unless you write a custom macro called via G code, you cannot change feed rate within a single block of information.

A block is a singular (1) command to the control. A command (block) for feed movement contains "a) the method with which to traverse [G1, etc], b) the end position to traverse to [X, Y, Z, A, B, C coordinates] and the speed at which to go there [F]. This is one command of information and will be executed as such by the control.

In order to do what you desire, you must break up your single command into several commands in order to change the feed rate for different areas of the path to be traveled.
 
thanks guys. sinha, i wish it was that easy. Tonytn36 understands and confirmed what i thought i will have to do. create a macro using g65 or g66 ?

ill have to keep reading these posts and educating myself about parametric programming.

thanks again guys.
 
You can create a macro with any unused G code if you want. You just need to assign that G code to the macro program to call in the parameters.
 
Hi jig grind dave, sorry to shim in like this, hope you find a solution to your problem, but I have a few
question about your machine, I'm too running (well doing some macros) for a jig grind (with a 31i control),
and that wonderful machine (Mitsui seiki $$$$) came with nothing (no macro) in the control, the tech guy had to
write some macro for us to at least grind some holes and slots, and a dressing macro. I was wondering if your control
came with macros, or a conversational interface ?
Thanks
 
i am the third person to take charge of this machine. i was not even a thought when they bought this thing, so i have no idea what it came through the doors with. it does not have a conversational interface. its a "moore" jig grinder. nice machine, though its the first jig grinder i have ever run so i have nothing to compare it to.
 
i am the third person to take charge of this machine. i was not even a thought when they bought this thing, so i have no idea what it came through the doors with. it does not have a conversational interface. its a "moore" jig grinder. nice machine, though its the first jig grinder i have ever run so i have nothing to compare it to.
Ok thank you !
 








 
Back
Top