Control the Z Scanner
Python
[set] You can retract the Z Scanner or adjust its operating range. [get] You can check the current position of the Z Scanner. [dependency] - SmartRemote
main
1 file
Control the Z …..py
control_z_scanner.py
756.0 B
Control the Z …..py
758 bytes
from SmartRemote import SmartRemote
class ControlZScanner:
def __init__(self):
self.__sr = SmartRemote()
def retract_z_scanner(self):
reply = self.__sr.run('spm.zscanner.retractAll()')
return reply['result']
def get_z_scanner_pos(self):
reply = self.__sr.run('spm.zscanner.pos')
pos = float(reply['value'])
return pos
def set_z_scanner_range(self,percent:int=70):
reply = self.__sr.run(f'spm.zscanner.changeRangeTo({percent})')
return reply['result']
if __name__ == "__main__":
czs = ControlZScanner()
czs.retract_z_scanner()
pos = czs.get_z_scanner_pos()
print(f'Z Scanner Pos.: {pos}')
czs.set_z_scanner_range(30)
Comments (0)
No comments yet. Be the first to comment!