'***************************************************************************
'Description:
'This program produces a sine wave of a desired amplitude and frequency
'sine motion will go on continuously unless go=0 is entered into terminal
'***************************************************************************
#sine
SH A;    'turns on motor A
amp= 100;  'amplitude in counts
freq= 10;  'frequency in Hz
rate= freq*amp*6.2832;   'calculates correct speed
VS rate
'set VA and VD if non-standard accel and decel are needed
#a
DPA= 0;   'sets position to zero- not necessary
#init
go= 1
' sine wave on "A" axis
VM AN
CR amp,0,360;  '1 sine wave to get started
BG S;   'starts motion
#l
CR amp,0,360;  'add 1 sine wave continuously
#wait
JP #l,_LM>1;   '_LM shows how many segments in buffer
JP #wait,go=1;   'continue adding sine waves until go=0 is entered
#stop
ST ;   'stops motion
AM S;  'waits for motion to complete
VE;  'ends vector mode
CS S;  'clears all sine waves out of vector buffer
MG "FINISHED"
EN