Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 1.26 KB

README.md

File metadata and controls

68 lines (45 loc) · 1.26 KB

EPOS4 Python

Python library for working with Maxon EPOS4 through UART without using libEposCmd library.

The library is incomplete yet!

At the moment you can use library with Profile Position Mode (PPM) only.

Available connection thorough UART only.

How to use

Folder epos4 contains code of the library.

Explanation of example_1.py.

  1. Making object of EPOS4. Setting COM for communication with Maxon EPOS4 through UART.
from epos4 import Epos4
from epos4 import definitions as df

e = Epos4('COM_NUM')
  1. Checking current Operation mode. Set to PPM if it isn't.
om = e.get_operation_mode().get()
if om != df.OM_PPM:
    e.set_operation_mode(df.OM_PPM)
  1. Checking Enabled state and set it
if not e.get_enable_state():
    e.set_enable_state()
  1. Checking Fault state. Moving to position if it isn't
if not e.get_fault_state():
    e.move_to_position(0xFFF)

Clear Fault state if it happened

e.clear_fault_state()

After clearing Fault state you have to check Enable state again

if not e.get_enable_state():
    e.set_enable_state()
  1. Don't forget to close connection in the end
e.close()

OTHER EXAMPLES