charly.server.devices
Class ChRobby

java.lang.Object
  extended bycharly.server.devices.ChRobby

public class ChRobby
extends java.lang.Object

This class needs the javax.comm- Java Extension.


Field Summary
(package private) static byte ETX
           
(package private)  java.io.InputStream In
           
(package private)  java.io.OutputStream Out
           
(package private)  javax.comm.SerialPort Port
           
(package private) static int RcvTimeOutMSec
           
 
Constructor Summary
ChRobby()
          installiert ChRobby an "COM1"
ChRobby(javax.comm.CommPortIdentifier comPort)
           
ChRobby(javax.comm.SerialPort comPort)
           
ChRobby(java.lang.String comPort)
          Diese Funktion erhält den Namen des Ports als Parameter, bspw.
 
Method Summary
private  void emptyInputStream()
           
 byte[] getAxes()
           
 int getAxisPos(int axisNr)
           
static void main(java.lang.String[] args)
           
 void reset()
          initializes ROB3.
 void setAxes(byte[] pos)
          Setzt Position aller sechs Achsen
 void setAxes(int[] pos)
          Setzt Position aller sechs Achsen
 void setAxisPos(int axisNr, int pos)
          Setzt Position der Achse axisNr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Port

javax.comm.SerialPort Port

Out

java.io.OutputStream Out

In

java.io.InputStream In

RcvTimeOutMSec

static final int RcvTimeOutMSec
See Also:
Constant Field Values

ETX

static final byte ETX
See Also:
Constant Field Values
Constructor Detail

ChRobby

public ChRobby()
        throws javax.comm.PortInUseException,
               javax.comm.NoSuchPortException,
               java.io.IOException
installiert ChRobby an "COM1"


ChRobby

public ChRobby(java.lang.String comPort)
        throws javax.comm.PortInUseException,
               javax.comm.NoSuchPortException,
               java.io.IOException
Diese Funktion erhält den Namen des Ports als Parameter, bspw. "COM1"


ChRobby

public ChRobby(javax.comm.CommPortIdentifier comPort)
        throws javax.comm.PortInUseException,
               java.io.IOException

ChRobby

public ChRobby(javax.comm.SerialPort comPort)
        throws java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        javax.comm.NoSuchPortException,
                        javax.comm.PortInUseException
Throws:
java.io.IOException
javax.comm.NoSuchPortException
javax.comm.PortInUseException

reset

public void reset()
           throws ChRobNotFoundException,
                  java.io.IOException
initializes ROB3. This is the only method to check, if ROB3 is present.

Throws:
ChRobNotFoundException
java.io.IOException

setAxisPos

public void setAxisPos(int axisNr,
                       int pos)
                throws java.io.IOException
Setzt Position der Achse axisNr

Parameters:
axisNr - Achsennummer (0-5)
pos - Neue Position (0-255)
Throws:
java.io.IOException

getAxisPos

public int getAxisPos(int axisNr)
               throws java.io.IOException
Parameters:
axisNr - - Achsennummer (0-5)
Returns:
Achsenposition (0-255) oder -1 bei Misserfolg bspw. bei Timeout
Throws:
java.io.IOException

setAxes

public void setAxes(int[] pos)
             throws java.io.IOException
Setzt Position aller sechs Achsen

Parameters:
pos - Neue Positionen: Array mit sechs Elementen mit Werten zwischen 0 und 255
Throws:
java.io.IOException

setAxes

public void setAxes(byte[] pos)
             throws java.io.IOException
Setzt Position aller sechs Achsen

Parameters:
pos - Neue Positionen: Array mit sechs Elementen mit Werten zwischen 0 und 255
Throws:
java.io.IOException

getAxes

public byte[] getAxes()
               throws java.io.IOException
Returns:
Positionen - Array mit sechs Elementen mit Werten zwischen 0 und 255 - oder null bei Misserfolg bspw. bei Timeout
Throws:
java.io.IOException

emptyInputStream

private void emptyInputStream()
                       throws java.io.IOException
Throws:
java.io.IOException