Installation manual

Chapter 6 Programming
6-48
Example: for Visual C++
float spd[7];
pa_set_tim(ARM0, 20);
Time-out setting(200msec)
for(i=0;i<7;i++) spd[i] = 0.0;
pa_odr_vel(ARM0, spd);
Velocity command initialization
pa_mod_vel(ARM0,VM_XYZ,0);
Velocity mode Base position selection
From here to “pa_sus_arm,” “pa_odr_vel” or “pa_chk_cnt” has to be issued within 200 msec. cycle.
spd[0] = 10.0;
spd[1] = -20.0;
spd[2] = 30.0;
pa_odr_vel(ARM0, spd);
Velocity command input
spd[0] = 0.0;
spd[1] = 20.0;
spd[2] = 0.0;
pa_odr_vel(ARM0, spd);
Velocity command input
pa_sus_arm(ARM0, WM_WAIT);
Velocity control termination
Example: for Visual BASIC
Dim spd(6) As Single
Dim ret As Long
ret = pa_set_tim(ARM0, 20)
For i=0 To 6 Step 1
spd(i) = 0.0
Next i
ret = pa_odr_vel(ARM0, spd(0)) Velocity command initialization
ret = pa_mod_vel(ARM0,VM_XYZ1,0)
spd(0) = 10.0
spd(1) = -20.0
spd(2) = 30.0
ret = pa_odr_vel(ARM0, spd(0))
spd(0) = 0.0
spd(1) = 20.0
spd(2) = 0.0
ret = pa_odr_vel(ARM0, spd(0))
ret = pa_sus_arm(ARM0, WM_WAIT)