I'm a Canadian currently working in a machine shop in Japan, with Swiss style machines. I run 6 different machines daily, 4 of which are Citizen L20s (2x 5M7, 7M8, 3M7), one Citizen B12 and a Tsugami B0205. I've noticed some machines have more restrictions than others. In this case, the GOTO command. One of my L20s(Named #69) can recognize GOTO commands, and the other(#18) cannot. It's not a huge deal on the L20s, as our company's programs and the parts we make are quite simple, I just have a little less freedom programming on #18 than #69.
On the Citizen L20s, there is an softkey you can press during the machining process called 'haraidashi.' I'm not sure what it's called in English, but when activated, it will re-run the back chuck machining process on the last part (typically a 120° drill used for caulking or a taping cycle). If you have experience on Swiss style lathes, I'm sure you know what I'm talking about.
Anyways, the Citizen B12 does not have this option, and I was planning to program it in by using the counter's macro(system variable) and an IF statement followed by a GOTO command to run the caulking once more on the last part. For example:
IF[#3901GE[#3902-1.]]GOTO64
GOTO65
N64
M98P6464
N65
yadayada
O6464 of course being the subprogram to rerun the back center drill which Z value I would also macro in
Anyways, this came up with an 'invalid address' alarm. To test the problem, I made a simple GOTO test program in MDI mode. The machine came up with the same error right on the GOTO command. Macros themselves seem to work, however. For example if I was to say:
#511=300.
M3S#511
The main spindle would rotate as expected at 300rpm. It's just the GOTO command that isn't registering. So my questions are,
Why will some machines accept GOTO commands, and some won't?
Is the any way around this, or any way to enable GOTO commands? I read somewhere the you need to change some parameters to make them work, but I'm not super keen on messing with something I don't understand fully.
Thank you in advance for taking the time to read.
-Andrew
First of all, the way you write it is not that clean :
IF[#3901LT[#3902-1.]]GOTO65
M98P6464
N65
yadayada
Just skip the sub pgm call under the condition #3901LT[#3902-1.]
Anyway Since the goto gives error it not gonna help you, not all controllers accept all kind of gcodes or bmacros command this is for sure and you have to adapt to what you have ...
Since the variables macros are working I would try this :
Create two subpgm (the one you want to call under the condition #3901LT[#3902-1.] and one that can do nothing) : O9001 and O9002
#9000=9002 (9002 IS CALLED BY DEFAULT)
IF[#3901LT[#3902-1.]]THEN#9000=9001 (UNDER CONDITION WE SWITCH THE SUB TO BE CALLED)
Be careful in controls with Goto Statements and conditions
Always put something on the end of the jump command even a note about somthing and i always use brackets right after to give the control time to catch the condition
Very hard but all to common an issue on Fanuc and will cause hrs of lost time trying to find it