What's new
What's new

parts counter

Blobis

Plastic
Joined
Aug 15, 2017
I've got a Okuma LB 12 at home, I know a complete dinosaur. but she kicks butt.
I'm doing this.

V01 = 1
N000 V01 = V01 + 1


( PROGRAM )


/ IF [ V01 LE 20 ] N000
M2

Works great, But if I have to reset it loses count ( the count starts over ) is there code that will keep the count even after reset?
 
Type V1=0 in MDI, cycle start. Leave it out of the program altogether.
Or if your control can run a schedule program (.sdf I think) you can do it easier there.
 
What I was thinking did work.

At the top of my program typically I have

N100 V1=1
N200 V2=2

....
Program
....

V1=V1+1
N700 IF [V1 LE V2] GOTO N200
N800 IF [V1 GE V2] GOTO N900
N900 M30


What I thought was, manually set V1 in the common variables to 0 before running the program the first time. Then Add this one line before N100.

IF [V1 LE V2] GOTO N200
N100 V1=1

If common variable is set to 0 the first run, it will start from the beginning of part count. Once it starts counting, the IF statement will make the program pick right back up on the last part count no matter how many times you stopped and loaded a new bar etc.... If you never reached the V2 part count it doesn’t reset V1 upon cycle start on a new bar of material.

You have to either reach total part count, or manually reset V1 to 0 in parameters Common Variable.
 
There are multiple ways to control machine behavior with programming variables etc. As well a couple of different approaches to achieve this as others have suggested.

Best of luck!
 
This should run the number of pcs. in v2 with out resetting v1
V1 would have to be entered in the macro's for the first time the program is run or you might get a number of pcs. not equal to V2 somewhere between 1-20 pcs.


$O0001.MIN%

N1
V2=20
IF[V1LT0]GOTO2(SAFETY RESET)
IF[V1GEV2]GOTO2(RESET COUNTER)
IF[V1GT0]GOTO3(BY PASS COUNTER RESET)

N2 V1=0
N3




V1=V1+1
IF[V1 GT V2]GOTO200
GOTO1
N200M30

%
 
Oh No, Got a alarm. at work, Its a OSP700L tried that code out on it to see if it works. must have typed it in wrong. the Alarm is 3205 ALARM-C WORK COUNTER OVER. I set the common variable back to zero but the Alarm still will not go away.
 








 
Back
Top