What's new
What's new

Fanuc guy trying to learn Okuma-please help

ACE323

Cast Iron
Joined
Mar 28, 2005
Location
New Hampshire
We just bought a brand new Okuma Genos. Control has Usertask2. I am trying to do a few things.
First, I cant figure out how to emulate a While/Do loop.
Ex
WHILE[#107LT#105] DO1
....
.....
......
#107=[#107+1]
END1

Second, How do I perform a Z-axis incremental workshift like this:

run 1st part

#5222=[#5222-#120] (#5222 is Fanuc system variable for G54 Z-axis workshift amount)

run 2nd part....

#5222={#5222-#120]

run 3rd part..

#5222=0.0(reset workshift back to zero before next barpull)

I have read the manual and it is hard to understand.
I have also found very little info on the web regarding Usertask2 examples.


Thanks

Scott
 
We user user variables and if then to accomplish your while/do. I can post an example of running multiple parts with work shift after each part, then bar pull, and work shift back.

I can get it tomorrow morning.

Sent from my SM-G900R4 using Tapatalk
 
you cant run Android apps on Apple phones in case you were wondering...
#5222 is something like VZOFY i believe(or YZOFZ?), someone else can elaborate. System variables are totally different memory addresses.
 
On my control (OSP U10L), I use VZSHZ.

ie: machine 1st part
VZSHZ=V42
machine 2nd part
VZSHZ=V43
machine 3rd part
M30

The VZSHZ shifts your Z0 by the amount in V42 (above example) to run the second part,
then shifts Z0 by the amount in V43 for the third part.

Maybe your control has the same or similar.
 
User Task 3 allows for WHILE/DO
I'm looking at my books now to see if I can be of more help, I rarely use Variables.
 
Can you run this program?

VC1=0 VC2=0
WHILE[VC2 LT 10] DO 1
VC1=VC1+VC2
VC2=VC2+1
END 1
M30

If you can't then you don't have the User Task 3 option,but I thought it was standard.
 
ACE323,

#5222=[#5222-#120] would look like this in Okuma User Task:

VZSHZ = [VZSHZ-V120] (SHIFTS WORK SHIFT AMOUNT)

Instead of using a WHILE statement, you can use an IF statement to create your parts counter. An example would look like this:

NTOP (add this line here at the top of the program)
(ENTER YOUR PROGRAM HERE)
V100 = V100 + 1 (THIS LINE ADDS ONE TO THE COUNTER, V100 VARIABLE)
IF [V100 NE V101] GOTO NTOP (CHECKS TO SEE IN MAX PARTS HAS BEEN REACHED)
M02

When trying to create a parts counter, I actually use the VWKCC[*] Work Counter. You can bring this screen up in AUTO mode by pressing F7 (NC OPR MONITOR). It would look something like this:

Counter.jpg

NTOP (add this line here at the top of the program)
(ENTER YOUR PROGRAM HERE)
VWKCC[1] = VWKCC[1] + 1 (THIS LINE ADDS ONE TO THE COUNTER, VWKCC[1] = WORK COUNTER A)
IF [VWKCC[1] NE VWKCS[1]] GOTO NTOP (CHECKS TO SEE IN MAX PARTS HAS BEEN REACHED)
M02

There is more about the VWKCC and VWKCS Work Counter in Addition Functions (page 38) in your P300L Operations Manual.

Hope that helps.
 
SAMPLE.jpg

LOCAL VARIABLES IN PROGRAM; ZL,ZL1,PCTR
COMMON VARIABLES ON PARAMETER PAGE “COMMON VARIABLES”;
V28=PART COUNTER PER SHIFT
V31=TOTAL PARTS NEEDED FOR JOB
V32=TOTAL PARTS RUN SO FAR

$SAMPLE-3UP.MIN%
N100 ZL=3.376 ZL1=1.188
/
/
/ PRIOR OPS
/
/
NT12 T1212S640 (CUTOFFS)
N110G00X2.7Z=ZL
N120G96S450
N130PCTR=0 (SET CUTOFF COUNT TO 0)
NAGEN Z=ZL-ZL1
N140G01X2.54F.02
N150X2F.004
N160Z=ZL1+.01
N170G00X2.7
N180PCTR=PCTR+1 V28=V28+1 V32=V32+1 (ADD 1 TO COUNTERS)
N190IF [PCTR EQ 3] NOUT (END OP AFTER 3 PCS.)
N200ZL1=ZL1+1.188 (RESET ZL1 VALUE)
N210GOTO NAGEN (LOOP BACK TO C.O. BEG.)
NOUT G97S640
N220G00X50Z=ZL+1 (RETURN X HOME, Z ZL+1”)
N230M05M09
N240IF [V32 LT V31] NA1 (SKIP M00 WHEN TOTAL NOT MET)
N250M00 (STOP MACHINE WHEN TOTAL QTY. MET)
NA1 M02 (REWIND TO PROGRAM START, CONTINUE RUNNING)
%

if I didn't screw this up, there's a pic to help explain. we'll feed out material for, say, 3 parts. do turning, boring, etc. then do 3 cutoffs as above. working with both "local" & "common" variables will prove a valuable tool if you do loops or family-of-parts programming. nice thing, you can use up to 4 characters to name local vars. ZL could be leng, PCTR could be pcs, whatever makes sense to you. the looping between NAGEN & NOUT can be used for grooving the 3 pcs. or any type feature throughout the program. comes in handy for just repositioning and calling a sub-prog. to repeat a part feature. we use common variables (28, 31, 32) for part counters through the run. easy to check or adjust if needed.
 








 
Back
Top