get_position(), IK320

get_position( encoder)
get_position( encoder, flag)
gp()

Reads to the VME controller cards of the Heidenhain encoders.

The optional argument flag can have 3 different values:

1 IK320: Calls a menu.

2 IK320, IK342: Tells the controller to wait for an axis to be moved over the reference points. A line of text is sent to the message window by the interrupt service function, if a reference mark has been found.

3 IK320: Resets the controller.

6 IK320: Initiates the power-on-self test.

e.g.:
* = gp( hhe1)

Here is a complete example:

#!/usr/local/bin perl -
#
# The encoders HHE5-8 watch MOT6.
# The reference point is somewhere between 16 and 17
# Operation: each axis is 'started' and then moved 
# over the reference point.
#
# Usage: 
#
# ONLINE> perl ref_mono_mirror.pl
#
use strict;
use Spectra;

my $ret;

Move( mot6 => "17"); 
#
# POST (power-on self test) for both HH cards
#
$ret = Get_position( "hhe5", 6); 
$ret = Get_position( "hhe7", 6); 

foreach my $enc (qw /hhe5 hhe6 hhe7 hhe8/)
{
    #
    # 'start'
    #
    $ret = Get_position( "$enc", 2); 
    #
    # move over reference point
    #
    Move( mot6 => "16.0"); 
    Move( mot6 => "17.0"); 
}

Cls();
print "\n\n\n"; 

foreach my $enc (qw /hhe5 hhe6 hhe7 hhe8/)
{
    print " $enc is at " . Get_position( "$enc") . "\n";
}