The hash %HEXAPOD provides an interface to the hexapod.
Note that there is an example of using the $HEXAPOD status in the Online manual.
The following example demonstrates how the hexapod is controlled from a Perl script.
#!/usr/bin/perl # use Spectra; # # get the parameters # ($x, $y, $z) = split ' ', $HEXAPOD{ xyz}; ($u, $v, $w) = split ' ', $HEXAPOD{ uvw}; ($r, $s, $t) = split ' ', $HEXAPOD{ rst}; ($r, $s, $t) = split ' ', $HEXAPOD{ pivot}; $vel = $HEXAPOD{ vel}; $rdy = $HEXAPOD{ rdy}; # moving ? # # set the parameters # $HEXAPOD{ xyz} = "$x $y $z "; $HEXAPOD{ uvw} = "$u $v $w "; $HEXAPOD{ rst} = "$r $s $t "; # the pivot point $HEXAPOD{ pivot} = "$r $s $t "; $HEXAPOD{ sxsysz} = "$sx $sy $sz "; # the step sizes $HEXAPOD{ susvsw} = "$sx $sy $sz "; $HEXAPOD{ vel} = 2;
It is alos possible to access the Hexapod via a function:
# # hexapod movements # $ret = hexapod( "x", $xpos); $ret = hexapod( "y", $ypos); ... # # reading the hexapod position # $ret = hexapod( "x"); $ret = hexapod( "y"); ...