What's new
What's new

Haas if then statement

Joined
Jun 4, 2024
Location
Ohio
I'm trying to write a if/then statement to trigger my bar feeder on my Haas DS30Y 2023.

I have an application where the stock is 3in from Chuck and I sub spindle grab the part to finsh the part. So I need to trigger the bar feeder to push the 3in for a new bar. The bar can make 6 parts with the sub grabbing. So I need the bar feeder to load a new bar and start it at 3in. Can anyone help me with a program to do so?
 
Last edited:
Haas bar feeders I ran, newer, you just put the parameter in the barfeed params.
 
The bar feeder would push the stock out 3in to start. Then the sub spindle is to pull the part out to do a few other ops on part. That way I'm not getting chatter. So the bar length is 4 foot and I can get 6 parts out of that. So I'm just needing the bar feeder to push the raw bar stock into the chuck.
 
I'm con- fu-zed sounds like you just need to read the manual.
I've even set double pushes with haas control.
 
Code:
#10000 = 0 (counter);

WHILE[#10000 LT 6] DO 1;
M98 Pxxxx (call subprogram);
#10000 = #10000 + 1;
END 1;

G105 Jxxx (barfeed);
M99;

Instead of the M98 call, you could also put all your code in there.
 
The bar feeder would push the stock out 3in to start. Then the sub spindle is to pull the part out to do a few other ops on part. That way I'm not getting chatter. So the bar length is 4 foot and I can get 6 parts out of that. So I'm just needing the bar feeder to push the raw bar stock into the chuck.
Haas barfeeders will no push to a stop or to the chuck without a servo alarm being triggered. If from what I understand you are pulling the bar from the main with the sub to prevent chatter while turning then that is a bit different. What I have done is use a g105 Jxxx to move my material forward after the pull. say you use the sub to pull the material 6 inches then you just use G105 J6.0 AFTER the pull.
ex
M111
G0 G53 B-6.0 ( CLAMP POSITION)
M110
M11
G0 G53 B0.0 (PULL 6 INCHES)
M10
G105 J6.0 K3.0
(CONTINUE WITH TURNING)

Then put your macro counter like Orange Vise said because unfortunately unless the actual bar length keeps up with the bar length measured by the barfeeder when you loaded the bar the auto bar load will not work correctly and Q codes do not work with NGC machines. I got 3 NGC machines where I work and I want to throw them in the ocean so badly, but the barfeeders deserve a whole new level of hell be put upon them. They are total garbage.
 
Last edited:








 
Back
Top