'This program allows the user to perform speed control 'using the analog input on the MDI. S5=9 'sets analog input to accept 0-5Vdc. S1=0,1 'sets I/O point 1 to general 'purpose output A=2000000 'acceleration set to '2000000 microsteps/sec/sec D=2000000 'deceleration set to '2000000 microsteps/sec/sec R4=20 'deadband PG 1 'initiate program at address 1 LB SU 'startup label. Program executes on power up LB ZZ 'label called ZZ R1 = I5 'register 1 set to analog input value CL ab 'computes new velocity by calling 'sub at label ab SL R3 'slew at the value of register 3 H 10 'wait 10 milliseconds BR ZZ 'branch to the label called ZZ E 'end of ZZ routine LB ab R1 = R1-508 'routine to determine 'direction and remove deadband R2 = 1 'offset from joystick center plus BR a1, R1>=0 'get dir of r1 R2 = -1 'negative direction minus R1 = R1 * R2 'get abs of r1 LB a1 BR A2,R1