What's new
What's new

Can you have a count down of the number of sub program iterations?

Seesecurity

Aluminum
Joined
Jun 20, 2017
Location
Brisbane Australia
I have a job that runs continuously for a week or so.
It requires a bar to be loaded every half hour or so, anyone in the shop that sees the blue light will go and load a new bar.
The program is a written as a sub program and called 20 times with a barpull for each part.
To reduce machine inactivity I need to know where in the cycle the program is, is it halfway through the last part or still on the second part etc so someone can go and see prior to going on their break/lunch.
Yes I know a barfeeder would be a lot better but I don't have the room.
Okuma LB300MY with OSP e100L control.
 
I do some similar work, I don't use a fixed number of repetitions per bar as it is a recipe for trouble if a bar is cut short, our material lengths can be supplied random from 5 to 6.5 meters and are not always cut up / divided into exact lengths.

Anytime you walk up to the machine you can look at the (V1) parameter and see how much of the bar is left.

I reset the bar length (V1) every time, or the program will only run once when a new bar is loaded.
(V4) is a completed parts counter.

$S1-02-04.MIN%

(S1-02-04 )

(25MM BRIGHT BAR)

(V1=BAR LNGTH)

(V2=PART LNGTH)

(V3=MIN SAFE LNGTH)

V2=35.0

V3=60

VZOFZ=9585.0 (BAR STICKOUT 45MM)

G50 S2000

M90

....... machining here.....



(BAR PULLER)

M66 M76

N500 M5 M9

V4=V4+1

G0 Z40 T060606 M5 M9 M66

G0 X0

G94

G1 Z0 F8000

G1 Z-44 F800

G4 F.5

M84

G4 F.5

G91

G1 Z[V2+4] F2500 (BAR PULLS PART LENGTH +4MM)

G4 F.5

M83

G1 Z20

G95 G90

G0 X180

V1=V1-V2-4

IF [V1 GE V3] GOTO N0100

G0 X280 Z100

M5 M9

M91

M30

%
 
I do some similar work, I don't use a fixed number of repetitions per bar as it is a recipe for trouble if a bar is cut short, our material lengths can be supplied random from 5 to 6.5 meters and are not always cut up / divided into exact lengths.

Anytime you walk up to the machine you can look at the (V1) parameter and see how much of the bar is left.

I reset the bar length (V1) every time, or the program will only run once when a new bar is loaded.
(V4) is a completed parts counter.

$S1-02-04.MIN%

(S1-02-04 )

(25MM BRIGHT BAR)

(V1=BAR LNGTH)

(V2=PART LNGTH)

(V3=MIN SAFE LNGTH)

V2=35.0

V3=60

VZOFZ=9585.0 (BAR STICKOUT 45MM)

G50 S2000

M90

....... machining here.....



(BAR PULLER)

M66 M76

N500 M5 M9

V4=V4+1

G0 Z40 T060606 M5 M9 M66

G0 X0

G94

G1 Z0 F8000

G1 Z-44 F800

G4 F.5

M84

G4 F.5

G91

G1 Z[V2+4] F2500 (BAR PULLS PART LENGTH +4MM)

G4 F.5

M83

G1 Z20

G95 G90

G0 X180

V1=V1-V2-4

IF [V1 GE V3] GOTO N0100

G0 X280 Z100

M5 M9

M91

M30

%
Thanks very much for that, I don't have the different length bar problem but I'm sure I can modify it to suit my needs.
 
If you run it as a schedule program, you can press the "Block Data" soft key and see how many it is set to run and what number you're currently on.
 
A schedule program is used to loop thru your main program a preset number of times.

A main program has a .MIN extension. A schedule program has a .SDF extension.

Mine is called RUNBAR.SDF, so I'll use that as an example. I'll call the main program MAIN.MIN.

RUNBAR.SDF
PSELECT MAIN.MIN ,,, Q20
END

This calls MAIN.MIN 20 times then stops. To run the schedule program, find the soft key that says SPSELECT. when you press it, it will bring up all schedule programs in memory.
Select RUNBAR and off you go.

.SDF programs aren't visible in edit unless you search for *.* If you just search for * it will only show .MIN programs.

Anyhow, once you select your schedule program and press cycle start, on the BLOCK DATA page there are two variables. One (pr) shows the value of Q, the other (pe) shows how many times you've run thru the main program.
 
A schedule program is used to loop thru your main program a preset number of times.

A main program has a .MIN extension. A schedule program has a .SDF extension.

Mine is called RUNBAR.SDF, so I'll use that as an example. I'll call the main program MAIN.MIN.

RUNBAR.SDF
PSELECT MAIN.MIN ,,, Q20
END

This calls MAIN.MIN 20 times then stops. To run the schedule program, find the soft key that says SPSELECT. when you press it, it will bring up all schedule programs in memory.
Select RUNBAR and off you go.

.SDF programs aren't visible in edit unless you search for *.* If you just search for * it will only show .MIN programs.

Anyhow, once you select your schedule program and press cycle start, on the BLOCK DATA page there are two variables. One (pr) shows the value of Q, the other (pe) shows how many times you've run thru the main program.
Thanks a lot, I'll try that out today.
 








 
Back
Top