com.pentec.adaq.sei
Class A2EncoderComm
java.lang.Object
com.pentec.adaq.sei.A2EncoderComm
public class A2EncoderComm
- extends java.lang.Object
A2EncoderComm
- Author:
- Pender Technology
|
Constructor Summary |
A2EncoderComm(int iAddress,
javax.comm.SerialPort serialPort)
|
A2EncoderComm(int iAddress,
java.lang.String $COMPort)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
$COMPort
private java.lang.String $COMPort
BAUDRATE
private static final int BAUDRATE
- See Also:
- Constant Field Values
DATABITS
private static final int DATABITS
- See Also:
- Constant Field Values
FLOWCONTROL
private static final int FLOWCONTROL
- See Also:
- Constant Field Values
iAddress
private int iAddress
inputStream
private java.io.BufferedInputStream inputStream
isExternalSerialPort
private boolean isExternalSerialPort
isMultiturn
private boolean isMultiturn
outputStream
private java.io.BufferedOutputStream outputStream
PARITY
private static final int PARITY
- See Also:
- Constant Field Values
serialPort
private javax.comm.SerialPort serialPort
STOPBITS
private static final int STOPBITS
- See Also:
- Constant Field Values
A2EncoderComm
public A2EncoderComm(int iAddress,
javax.comm.SerialPort serialPort)
throws java.lang.IllegalArgumentException,
A2ChecksumException,
java.io.IOException,
A2OperationFailedException
- Throws:
java.lang.IllegalArgumentException
A2ChecksumException
java.io.IOException
A2OperationFailedException
A2EncoderComm
public A2EncoderComm(int iAddress,
java.lang.String $COMPort)
throws java.lang.IllegalArgumentException,
java.lang.Exception
- Parameters:
$COMPort -
- Throws:
java.lang.Exception - COM port open failure
java.lang.IllegalArgumentException
close
public void close()
getAddress
public int getAddress()
getMode
protected byte getMode()
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
getPosition
public int getPosition()
throws java.io.IOException
- Throws:
java.io.IOException
getResolution
public int getResolution()
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
getSerialNumber
public int getSerialNumber()
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
getSerialPort
public static javax.comm.SerialPort getSerialPort(java.lang.String $COMPort)
throws java.lang.Exception
- Throws:
java.lang.Exception
isMultiturnMode
public boolean isMultiturnMode()
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
main
public static void main(java.lang.String[] args)
open
protected void open()
throws java.lang.Exception
- Throws:
java.lang.Exception
setAbsolutePosition
public void setAbsolutePosition(int iPosition)
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
setAddress
public void setAddress(int iAddress)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
setAddressBySerialNumber
public void setAddressBySerialNumber(int iSerialNum,
int iAddress)
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
setMode
protected void setMode(byte bMode)
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
setMultiturnMode
public void setMultiturnMode(boolean isEnabled)
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
setOrigin
public void setOrigin()
throws java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Throws:
java.io.IOException
A2ChecksumException
A2OperationFailedException
setResolution
public void setResolution(int iResolution)
throws java.lang.IllegalArgumentException,
java.io.IOException,
A2ChecksumException,
A2OperationFailedException
- Parameters:
iResolution - 1-65536 (only guaranteed accurate to 12 bits)
- Throws:
java.lang.IllegalArgumentException
java.io.IOException
A2ChecksumException
A2OperationFailedException
sleep
public void sleep()
throws java.io.IOException
- Throws:
java.io.IOException
strobe
public void strobe()
throws java.io.IOException
- Throws:
java.io.IOException
verifyChecksum
public boolean verifyChecksum(byte[] abCommand)
wakeup
public void wakeup()
throws java.io.IOException
- Throws:
java.io.IOException