Skip to content

Instantly share code, notes, and snippets.

@mkhorasani
Created May 20, 2021 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkhorasani/ad601012b33e86433367388fc3b4d086 to your computer and use it in GitHub Desktop.
Save mkhorasani/ad601012b33e86433367388fc3b4d086 to your computer and use it in GitHub Desktop.
if __name__ == "__main__":
# Initiating connection and setting motion profile
keyHandle = epos.VCS_OpenDevice(b'EPOS2', b'MAXON SERIAL V2', b'USB', b'USB0', byref(pErrorCode)) # specify EPOS version and interface
epos.VCS_SetProtocolStackSettings(keyHandle, baudrate, timeout, byref(pErrorCode)) # set baudrate
epos.VCS_ClearFault(keyHandle, nodeID, byref(pErrorCode)) # clear all faults
epos.VCS_ActivateProfilePositionMode(keyHandle, nodeID, byref(pErrorCode)) # activate profile position mode
epos.VCS_SetEnableState(keyHandle, nodeID, byref(pErrorCode)) # enable device
epos.VCS_SetPositionProfile(keyHandle, nodeID, 5000, 30000, 30000, byref(pErrorCode)) # set profile parameters
epos.VCS_MoveToPosition(keyHandle, nodeID, 100000, True, True, byref(pErrorCode)) # move to position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment