Created
May 20, 2021 08:14
-
-
Save mkhorasani/ad601012b33e86433367388fc3b4d086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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