Main program

  1. Define a state machine in the implementation.
  2. Initialization: When the start command is set, the state changes to 10.
  3. Activate the "Velocity" mode.
  4. Select the "Open loop" operating behavior and start the mode.
  5. Let the motor rotate for 3 seconds.
  6. Set the speed to 0. When the motor is at standstill, the state changes to 50.
  7. Stop the motor, deactivate the mode and reset the timer and the state machine.
  • The complete program looks like this: