![background image](http://html1.mh-extra.com/html/omron/smartslice-grt1-ml2/smartslice-grt1-ml2_programming-manual_742305052.webp)
BASIC commands
PROGRAMMING MANUAL
46
R
e
vi
si
o
n
1
.0
fig. 5
/i
/i
Example
Motion is required to follow the POSITION equation:
t(x) = x*25 + 10000(1-cos(x)), where x is in degrees. This example table pro-
vides a simple oscillation superimposed with a constant speed. To load the
table and cycle it continuously the program would be:
FOR deg=0 TO 360 STEP 20 'loop to fill in the table
rad = deg * 2 * PI/360 'convert degrees to radians
x = deg * 25 + 10000 * (1-COS(rad))
TABLE(deg/20,x) 'place value of x in table
NEXT deg
WHILE IN(2)=ON 'repeat cam motion while input 2 is on
CAM(0,18,1,200)
WAIT IDLE
WEND
TABLE position
Degree
Value
1
0
0
2
20
1103
3
40
3340
4
60
6500
5
80
10263
6
100
14236
7
120
18000
8
140
21160
9
160
23396
10
180
24500
11
200
24396
12
220
23160
13
240
21000
14
260
18236
15
280
15263