Skip to content

Commit

Permalink
fixing code
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasM2001 committed May 6, 2024
1 parent 0106870 commit 38142ba
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions examples/lab_devices/MotorStage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
dut = Dut('mercury_pyserial.yaml')
dut.init()

# setup (for c-862)
# setup (for c-862)
# needed if mercury is connected the first time after power up
# MN Motor=on
# LL: switch logic active low (hardware)
Expand All @@ -25,26 +25,26 @@
time.sleep(0.1)

# move absolute 1000:
#dut["MotorStage"].set_position(1000, address=1)
dut["MotorStage"].set_position(1000, address=1)

# get position:
#print(dut["MotorStage"].get_position(address=1))
# print(dut["MotorStage"].get_position(address=1))

# move relative 1000:
#dut["MotorStage"].move_relative(1000,address=1)
# dut["MotorStage"].move_relative(1000,address=1)

# finding edge example:
print(dut["MotorStage"].get_position(address=1), "position before")
time.sleep(1)
dut["MotorStage"].find_edge(1, address=1) # find edge 0=postive 1=negative
dut["MotorStage"].wait_FE(address=1)
print(dut["MotorStage"].get_position(address=1), "position after") # print position after movement
# print(dut["MotorStage"].get_position(address=1), "position before")
# time.sleep(1)
# dut["MotorStage"].find_edge(1, address=1) # find edge 0=postive 1=negative
# dut["MotorStage"].wait_FE(address=1)
# print(dut["MotorStage"].get_position(address=1), "position after") # print position after movement

# example of an relative movement using wait_pos
#move_r=20000
#target = dut["MotorStage"].get_position(address=1)+move_r
#dut["MotorStage"].move_relative(move_r,address=1)
#dut["MotorStage"].wait_pos(target,500,1)
# move_r=20000
# target = dut["MotorStage"].get_position(address=1)+move_r
# dut["MotorStage"].move_relative(move_r,address=1)
# dut["MotorStage"].wait_pos(target,500,1)

# abort any movement abruptly:
#dut["MotorStage"].abort(address=1)
# dut["MotorStage"].abort(address=1)

0 comments on commit 38142ba

Please sign in to comment.