KINGSTAR 4 Motion porting information

If you have used KINGSTAR 3.x before, you'll notice that KINGSTAR updates the motion library that breaks the compatibility between version 3.x and 4.x. To clear up the confusion you might have, we list the primary changes KINGSTAR makes in 4.x motion library.

The PLCopen and motion board style APIs have been merged into a single API set which provides the simplicity of the motion board style and the flexibility of the PLCopen style.

  1. Naming convention.
  2. Names use VerbAxisType. For example, MC_MoveAbsolute and MoveServoAbsolute become MoveAxisAbsolute.

  3. Command states and outputs are optional. They are stored in a KsCommandStatus return structure. You no longer need to pass pointers for each output variable. This KsCommandStatus structure includes a handle that identifies the command.
  4. The state of commands can be queried with GetCommandStatus using the KsCommandStatus instead of queue indexes.
  5. Calling MoveAxisAbsolute allways creates a new command. To modify an existing command use UpdateCommand and pass the KsCommandStatus.
  6. Cancelling commands like StopAxis is now done using the AbortCommand method.
  7. You can block a thread until a command is completed or aborted using the WaitForCommand method.

Examples