Peripheral mySer As ServoRunnerA @ 0 ' Set the module To be operated As 0. ' Set the module ID As 0. Note: The module number must be set To '0 Or 1 To use the servomotor related command of the Servo Commander A. Dim EventEnd As Byte ' Store the variable For determining the completeness of the event. Dim i As Byte ' Store the Loop variable. Dim SerStatus As Byte ' Store the Status of the Servo Motor. Sub Main() ' Main subroutine mySer.SetPosOffset(0, 0) ' Set the offset value of Servo0 As 0. mySer.SetPosAndRun(0, 1500) ' Activate Servo0 To move To the position 1500. Pause 1000 ' Pause a time interval For the servo motor To move To the target position. mySer.SetPos(0, 2200) ' Set the target position of Servo0 As 2200. mySer.SaveFrame(0) ' Store the motion of the currently indicated servo motor into Frame0. mySer.Run1Servo(0) ' Allow Servo0 To start the motion. Pause 500 mySer.SetPosSpdAndRun(0, 700, 1000) ' Activate Servo0 And Then move To the position 700 at a speed of 1000. Pause 2000 mySer.SetPosTimeAndRun(0, 2200, 1000) ' Activate Servo0 And move To the position 2200 For a time interval of 1 second. Pause 1000 EventEnd=0 mySer.SetPosTime(0, 700, 1000) ' Set Servo0 To move To the position 700 For a time interval of 1 second. mySer.SaveFrame(1) ' Store the motion of the currently indicated servo motor into Frame1. mySer.Run1ServoWithEventA(0) ' Activate Servo0 And generate EventA when it completes the operation. Do Pause 1 Loop Until EventEnd=1 ' The following loop repeats to read the setting values in Frame0 and then activate Servo0 for operation. ' The position value stored in Frame0 is 2200. The position value stored in Frame1 is 700. ' Servo0 will move between these two positions back and forth 4 times. For i=0 To 3 mySer.LoadFrame(1) ' Read the setting value stored In Frame1. mySer.Run1Servo(0) Pause 1000 mySer.LoadFrame(0) ' Read the setting value stored In Frame0. mySer.Run1Servo(0) Pause 1000 Next mySer. SetPosAndRun(0, 1500) ' The following loop repeats to perform the operation of reading the Status. ' After the completion of the operation is confirmed, the loop will stop. Do mySer.Get1ServoReadyStatus(0, SerStatus) ' Read the status of Servo0 And Then store it In SerStatus. Loop Until SerStatus>0 End Sub Event mySer.ServoPosReadyEventA() mySer.SetPosAndRun(0, 2200) Pause 1000 EventEnd=1 End Event