From b30b71394ed46a9cac46d644881ea3d2a8467a53 Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Wed, 3 Jul 2019 16:28:19 +0200 Subject: [PATCH] Script execution --- script/device/Hexapod.py | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 script/device/Hexapod.py diff --git a/script/device/Hexapod.py b/script/device/Hexapod.py new file mode 100644 index 0000000..2ec5f1b --- /dev/null +++ b/script/device/Hexapod.py @@ -0,0 +1,51 @@ +_hex_baseplate_thickness=20.0 + + +# ---------------------------------------------------------------------- +def hex_show_pivot_point(): + x = caget("X04SA-ES3-HXP:RBPIVOT_X") + y = caget("X04SA-ES3-HXP:RBPIVOT_Y") + z = caget("X04SA-ES3-HXP:RBPIVOT_Z") + z = z - _hex_baseplate_thickness + + print("pivot point xyz = (%.4f, %.4f, %.4f) mm relative to center of Hexapod top plate surface\n" % (x,y,z)) + + +# ---------------------------------------------------------------------- +def hex_set_pivot_point(x, y, z): + # check if the dial values of the rotations are zero + if (hrox.read() != 0.0) || (hroy.read() != 0.0) || hroz.read() ) != 0.0)) { + print("The dial positions of the Hexapod rotations hrox, hroy and hroz have") + print("to be at their zero position to set the pivot point.") + return + + z = z + _hex_baseplate_thickness + + caput("X04SA-ES3-HXP:PIVOT_X", x) + caput("X04SA-ES3-HXP:PIVOT_Y", y) + caput("X04SA-ES3-HXP:PIVOT_Z", z) + + hex_show_pivot_point() + + +""" +def hex_ini(): + print ("Initialiaze Hexapod C-887 through EPICS\n") + home hx + waitmove + + +# ---------------------------------------------------------------------- +def hex_show_all '{ + printf("PI C-887 Hexapod:\n") + hex_show_pivot_point + printf("\n") + wm hx hy hz hrox hroy hroz +}' + +#--------------------------------------------------------------------- +# Oveloading of function +def hexaShow '{ + hex_show_all +}' +""" \ No newline at end of file