View Full Version : Need help with IF ,THEN,AND GOTO USING COMMON VARIABLES.


XRACERJB
08-29-2007, 12:55 AM
Can anyone give me a sample prog.using IF,THEN,AND GOTO as counters
using common variables.I want to get away from sub-prog's. lots of short runs
and i think this would save time.only one prog to load,read,etc.

any help would be greatly appreciated.

J.B.

cogsman1
08-29-2007, 06:58 AM
Here are some samples that I use.


IF[#552EQ666]AND[#547EQ666]GOTO731

*
IF[#587NE4100]GOTO500

*
IF[#591LT10]GOTO118

*
WHILE[#108GT[#109+#110]]DO1
#108=[#108-#109]

M98H#502L#111

END1

*
#180=[#571/SIN[90-#570]]
#180=[[#180*TAN[90/2]]*2](#7/D)
#181=[[#557/2]/SIN[45]](#5/J)
#182=[#571*TAN[[90/2]-#570]]
#183=[#571*TAN[[90/2]+#570]]
#183=[[#182+#183]/2]
#184=[#181-#183]
#183=[#183-#182]

*
(milling interpolation)
G12.1
G17

G0U-[[#556-#550]/2]Y[[#557-#550]/2]
V-[.039-[#550/2]]
G98G1Z#525+.012F4.
Y-[[[#557-#550]/2]-[.039-[#550/2]]]
G3V-[.039-[#550/2]]U[.039-[#550/2]]R[.039-[#550/2]]
G1U[[#556-#550]-[[.039-[#550/2]]*2]]
G3U[.039-[#550/2]]V[.039-[#550/2]]R[.039-[#550/2]]
G1Y[[[#557-#550]/2]-[.039-[#550/2]]]
G3V[.039-[#550/2]]U-[.039-[#550/2]]R[.039-[#550/2]]
G1U-[[#556-#550]-[[.039-[#550/2]]*2]]
G3U-[.039-[#550/2]]V-[.039-[#550/2]]R[.039-[#550/2]]
G1Y0
U[[#556-#550]/2]
G0G40Z-.05

G13.1

JMS4287
08-31-2007, 08:08 AM
Here's a quick Example of a palletizer postioning prog.

(#616= current row position)
(#619= total # of rows per pallet)

O8101(PALLET COLUMN COUNT PROGRAM)
N2001
IF[#616GE[#619*2]]GOTO2002
#623=#616
#620=#621
IF[#616GE#619]THEN#623=[#616-#619]
IF[#616GE#619]THEN#620=#622
#617=#620-[#623*#618]
#1132=BCD[#617*10.]
#616=#616+1.
M99

N2002
#616=0
M16
GOTO2001