# Altek AC40 digitizer, binary output format 8
#
# Originally built and tested by 
#
#   Lars Schylberg                    
#   Department of Photogrammetry 
#   Royal Institute of Technology    
#   S-100 44  STOCKHOLM, SWEDEN     


setup
{
    digname = Altek
    description = Altek digitizer, binary output format 8
    buttonoffset = 1      #button output starts at 0, we want 1
    buttonstart = 0       #first button is numbered 0
    buttons = 16          #number of buttons is 16
    baud = 9600
    units_per_inch = 1000
    stop_bits = 2
    data_bits = 8
    parity  = none
}
 
startrun
{
    send = S2\013         #set to run mode 
    send = F8\013         #set output format to 8 
}
startpoint
{
    send = P\013         #set to point mode
    send = F8\013        #set output format to 8 
}
startquery
{
    send = P\013         #altek has no specific prompt mode, but may be
                          #queried at any time, so set to point mode
    send = F8\013         #set output format to 8
}
 
query
{
    send = V\013          #request data
}
 
stop
{
    send = \027\013       #reset
}
 
format    # output format 8
{
    byte1 = 1   p  b3  b2  b1  b0 x15 x14
    byte2 = 0 x13 x12 x11 x10  x9  x8  x7
    byte3 = 0  x6  x5  x4  x3  x2  x1  x0
    byte4 = 0   ?   ?   ? x16 y16 y15 y14
    byte5 = 0 y13 y12 y11 y10  y9  y8  y7
    byte6 = 0  y6  y5  y4  y3  y2  y1  y0
}
