Low-level Python or simplified wrapper modules to send commands to Standa controllers.
- 8SMC5 - smc8.py
- Connect to Standa Controllers
- Query state and parameters
- Move individual axes to absolute or relative positions
importtimefromsmc8importSmcController# Open connection examples dev=SmcController(log=False)
dev.connect(device_str="192.168.31.123/9219", connection_type="xinet")
# ORdev.connect(device_str="/dev/ximc/00007DF6", connection_type="serial")
time.sleep(.25)
# Initialize dev instancedev.initialize() # checks statusstatus=dev.status() # Homes devicedev.home() time.sleep(5) #Give time for stage to move# Query Positionpos=dev.get_pos() # Query Position# Move to absolute positiondev.set_pos(position=5) #positive ot negativetime.sleep(5)
# Move to position relative of its current posdev.set_pos(position=10, abs_move=False) time.sleep(5)
# Perform absolute movedev.move_abs(100)
# Perform relative movedev.move_rel(-20)
print(dev.get_pos()) # Should be 80dev.home()
time.sleep(5)
#Close connectiondev.disconnect()Unit tests are located in tests/ directory.
TODO: Make "Mock test" for PPC102 get_position and get_status which threw errors and was removed. Assumed to be due to the byte and int convertion
To run tests from the project root based on what you need: Software check:
pytest -m unitConnection Test:
pytest -m defaultFunctionality Test:
pytest -m functional