Hi, why when I enter for example "#100=1" I get the wrong code in my lathe?
my code:
%
o00000
T0101
G54 G90
G50 S1500
G96 S200 M03 F0.1
#100=1
#101=10
G00X100.Z2.
WHILE[#100LE#101] DO1
G01 Z-50.
G91 X1.
G90 G00 Z2.
G91 X-2.
#100=#100+1
END1
M30
%
Hi, why when I enter for example "#100=1" I get the wrong code in my lathe?
my code:
%
o00000
T0101
G54 G90
G50 S1500
G96 S200 M03 F0.1
#100=1
#101=10
G00X100.Z2.
WHILE[#100LE#101] DO1
G01 Z-50.
G91 X1.
G90 G00 Z2.
G91 X-2.
#100=#100+1
END1
M30
%
Do you have Macro turned on
I don't know. How can I check this?
I believe it's parameter 57 (COMMON SWITCH 1) bit #22 ENABLE MACRO. should be 1 if the option is turned on.
Not sure if it's an issue, but I always use decimals in my macros. So "#100=1."
Not sure exactly what you mean by “wrong code” but I would say that you need a G90 on the the G01 Z-50. Line
If you follow the loop through, the last command is G91 X-2 so when you loop back to G01 Z-50 this will be an incremental move and would only actually move to Z-48 as you are at Z2 when you execute that line.
Hope that helps.
My bad. I assumed you got an alarm when you tried to load that code into the machine. If this is the case, what is the exact alarm?
One other thing, on the Haas lathe, G90 is NOT "Absolute", it's a turning cycle command. And G91 is NOT "Incremental"... use X and Z for absolute commands, and use U and W for incremental commands.
I read my instruction today and there is nothing about parameter 57:22 I found: https://diy.haascnc.com/printpdf/reference-docs/macro-programming-information How to set this parameter to 1? I'm a beginner.
PS. I removed G90 and G91 of course.
I'm not 100% sure on this, but I believe you can turn the option on for a trial (100 hours?), but it'll revert to off after the trial expires.
You need to turn Setting 7 Parameter Lock OFF, then go to Parameter 57 bit 22 and change it to 1, then change Setting 7 back to 1 to lock the parameters again.
It's been a while since I've pretended to be a Haas expert, though, so you might want to contact your HFO to be sure.