What's new
What's new

fast porgram repeate with patern

civicske2

Aluminum
Joined
Nov 29, 2015
hy folks
first of all excuse me for the writing error in title, but cant seem te edit title
we are now running a brother tcs2a on the iso mode. it takes most of fanuc/iso commands.
with the brothers we are running on dialog you can easely set a patern when putting more parts on the table, you just put in the amount of parts, Xshits and Yshifts.
is there an easy way to do it with fanuc?

i m currently thinking of something as making a macro but i am not familiar with this
i would like to give next arguments.

Number of pcs X
Number of pcs Y
Offset X
Offset Y

then something that is running

M98 P1 L1
G10 X (shift)
M98 P1 L1
G10 X (2x shift)
... this till it reaches the number of positions in X

Than
G10 Y shift

then repeate the line till at max X pcs again...

repeate till also reache max Y rows.



hope its clear, was not easy to write it down
thanx!!!
 
As an ex IT guy any nr of solutions come to mind.
I don´t know fanuc.
I have no idea what the "best" solution is, or if any "good" solution exists.

1. You could use arrays like part_corner_x(n) with a counter or id.
2. Variables.
E.
offset_var = 10
offset = cycle_nr + offset_var
3. Incremental math, like partn x counter x (1+offset).
4. Adjusting homing.
5. Adjust work co-ordinate systems, depending on nr of parts and control.

A clever guy would *always* write and read the data to a tiny text file, every cycle, before running, and after running (write ok, timestamp, part nr).
This would prevent major messes if power is ever interrupted, glitches, estops etc.

A clever guy would also initialise all major modal states, every cycle as appropriate.
This avoids major catastrophic errors of all sorts.
Things like plane, feed mode, feed override, ss override, metric, scaling, *feed*, ss, etc.

A really clever guy might also add a tiny script that does a tiny small feed, slowly, like 1 micron.
This might not move the machine - it is immaterial.
It would take less than 0.01 secs.
And then checks the machine and co-ordinate systems data, and compares them to expected values.

A stop, estop, hold, override, limit switch, soft limits or hw estop on say power conditioning or spindle overload or whatever - will not always leave the machine in the state You expected it to.
No - It Wont.
Mostly - yes, sometimes, no.

The modals + gcode stuff have over 16M permutations - interpreted differently - handled differently - with bugs, legacy stuff, and manufacturer specific features.

It is not really important how the manufacturer /controller/firmware handled stuff.
No-one will ever state/test/debug all combos - nor do they need to.

If YOU make the machine take a given "state" - it will always respond as You expect it to.

Anecdote.
It was an experience watching my lathe take off at max hw speed towards the chuck, when given a G1 Z-10 (in mm).
It "thought" it was in feed mode of mm/rev.
But the control showed feed/min !
In certain conditions on a specific canned threading cycle, an interrupted threading op. could do so.
So the control tried its best to crash in 0.5 secs into the chuck at 500 rpm or so.
Since it was trying to feed at 10 mm / rev or 500 mm /sec.

All the above is mostly a comment on one way why/how unattended or high reliability machine running can be well done.
I tried to use pseudocode - easier to read and understand.
Esp. for newbies and similar later reading this thread.

I did a lot of similar high-availability stuff in the past, for high numbers of production systems and kit.
My recommendations are based on experiences over thousands of installs, different, serving tens of thousands of users at once, with near-perfect relative reliability (aka much better than anyone else in the field.).

My recommendation is for various ways to solve it - easy and cheap.
Anyone will write you a script, for 200$-500$, if you do a code for 4 moves (square) and ask for a working program of type 1-5.

Depending on the size of the company, the *best* option is much more complex, and expensive, and vastly better.
Use a centralised proper dB,
machine-local files for passing data (bulletproof, simple, will work with any control/hw/sw/system forever),
triggers in the dB, etc.
A small business should not even think about this. Not worth it.

I did not recommend any method - and many others are surely possible.
Readability, maintenance, reuse, portability, compatibility with other controls/versions/fw/sw may be issues.
HTH.
 
civicske2, do you have or do you know someone with a Speedio Brother? The C00 control on the Speedio has a feature that can convert the Brother Conversational programs to G Code. I believe it uses G10 for multiple parts.
 
Can you do a simple WHILE command?

variable 1=loop count
variable 2=total parts
Variable 3=x distance
variable 4=y distance that row

WHILE[#1LT#2]DO1
G10X[#3*#1] <-----if that is the G command for the shift? That way it automatically calculates where the next shift is instead of having to enter values
M98P1L1
#1=#1+1
END1

Not sure if something like that would work. You would need to add logic and another counter for Y's, if you can do a WHILE statement i can help you with that, if not, well then theres probably another way native to the control to do what you are asking, but i have no experience with that control so cant speak on that.
 
Eureka

Can you do a simple WHILE command?

variable 1=loop count
variable 2=total parts
Variable 3=x distance
variable 4=y distance that row

WHILE[#1LT#2]DO1
G10X[#3*#1] <-----if that is the G command for the shift? That way it automatically calculates where the next shift is instead of having to enter values
M98P1L1
#1=#1+1
END1

Not sure if something like that would work. You would need to add logic and another counter for Y's, if you can do a WHILE statement i can help you with that, if not, well then theres probably another way native to the control to do what you are asking, but i have no experience with that control so cant speak on that.

Hy verry much thanks this was really what was in my head but i couldnt figure it out because i am not good at macro programming. Pretty shure machine will take it! Can you help me to do the same trick in Y?
Within one row there will not be a Y distance. I just would need something that wan at the end of what you wrote gives a Y offset and repeate till al rows are finished. Much thanks
 
Hello. Yes we have few speedios. Never ran programes of older brothers there. Our speedios are operating g code. Never conversial. I am pretty shure g10 will work for this. Thanks for ur reply
 
Ok

variable 1=loop count
variable 2=total parts
Variable 3=x distance
variable 4=y distance that row

variable 5=y counter
variable 6=y amount total

WHILE[#5LT#6]DO1
G52Y[#5*#6]
G90X0Y0 <----Assumption on my part is the first part is X0/Y0
M98P1L1
WHILE[#1LT#2]DO2
G52X[#3*#1] <-----if that is the G command for the shift? That way it automatically calculates where the next shift is instead of having to enter values
M98P1L1
#1=#1+1
END2
G52X0Y0 <-----Since the loop calls the shift, at the very end this G52 cancel is used so that as the program continues on it doesnt keep a shift active, this will minimize unforseen circumstances
#5=#5+1
END1

**********I havent had enough coffee yet, I might have to edit this post later***************

This should make it look like a typewriter so to speak, but i think i am forgetting something, i just cant figure it out right now.
 
Hello,
thanks to the time shift i think that i already had enough coffie :-)
this is what ive got now and is working as i want.
it would be nice if you would go trough it to kind of debug it and maybe make it more idiot proof

%S O0007
O0007
#110=3 (AANTAL IN X)-->Pcs X
#111=20. (STAP IN X)-->pitch X
#115=2 (AANTAL IN Y) -->Pcs Y
#116=-10. (STAP IN Y)-->Pitch Y
(//////////////////////////////////)
#140=[#110*#115] (TOTAAL AANTAL ST)
#141=0(TELLER IN X RESET)
#142=0(TELLER IN Y RESET)
#135=0.( Y SHIFT RESET)
(X HERHALING)
N100WHILE[#141LT#110]DO1
G52X[#111*#141]Y[#135]
M98 P5 L1
#141=#141+1
END1
#141=0(TELXRST)
#142=#142+1(TELY)
#135=#135+#116(SHIFT Y)
IF[#142LT#115] GOTO100
M2
%
 








 
Back
Top