Peripheral mySer As ServoRunnerA @ 0 ' Set the module To be operated As 0 Dim EventEnd As Byte ' Store the variable For indicate the completion of the Event Dim i As Byte ' Store the Loop variable Dim SerStatus As Byte ' Store the Status of the Servo Sub Main() ' Main subroutine mySer.SetPosOffset(0, 0) ' Set the offset value of Servo0 As 0 mySer.SetPosAndRun(0, 1500) ' Run Servo 0 To position 1500 Pause 1000 ' Pause For the servo To move To the target position mySer.SetPos(0, 2200) ' Set the target position of Servo 0 As 2200 mySer.SaveFrame(0) ' Save the current motion As Frame 0 mySer.Run1Servo(0) ' Allow Servo 0 To start the motion Pause 500 mySer.SetPosSpdAndRun(0, 700, 1000) ' Servo 0 moves To the position 700 at speed 1000 Pause 2000 mySer.SetPosTimeAndRun(0, 2200, 1000)' Servo 0 moves To the position 2200 In 1 second. Pause 1000 EventEnd=0 mySer.SetPosTime(0, 700, 1000) ' Set Servo 0 To position 700 In 1 second mySer.SaveFrame(1) ' Save the current motion As Frame1 mySer.Run1ServoWithEventA(0) ' Run Servo 0 And generate EventA when completes Do Pause 1 Loop Until EventEnd=1 ' Repeats To load values In Frame 0 And Frame1 And Then activate Servo 0 For operation. The ' position value stored In Frame 0 is 2200. The position value stored In Frame1 is 700. Servo 0 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 Frame 1 mySer.Run1Servo(0) Pause 1000 mySer.LoadFrame(0) ' Read the setting value stored In Frame 0 mySer.Run1Servo(0) Pause 1000 Next mySer.SetPosAndRun(0, 1500) ' The following Loop repeats To perform a Status reading operation. After completion of the operation ' is confirmed, the Loop will stop Do mySer.Get1ServoReadyStatus(0, SerStatus) ' Read Servo 0 And store it In SerStatus Loop Until SerStatus>0 End Sub Event mySer.ServoPosReadyEventA() mySer.SetPosAndRun(0, 2200) Pause 1000 EventEnd=1 End Event