org.mbari.siam.devices.bbElec
Class BB232SDD16

java.lang.Object
  extended by org.mbari.siam.devices.bbElec.BBElec
      extended by org.mbari.siam.devices.bbElec.BB232SDD16

public class BB232SDD16
extends BBElec

Class to encapsulate operations to 232SDD16 RS-232 Digital I/O module from B&B Electronics


Field Summary
protected  int _outputState
           
protected static byte[] DEFINE_IO
           
protected static byte[] READ_CONFIG
           
protected static byte[] READ_INPUT
           
protected static byte[] SET_OUTPUT
           
protected static byte[] SET_PWRUP
           
 
Fields inherited from class org.mbari.siam.devices.bbElec.BBElec
_in, _log4j, _out, _serPort, _tmout, DFLT_TMOUT
 
Constructor Summary
BB232SDD16(gnu.io.SerialPort serport)
          Constructor
BB232SDD16(gnu.io.SerialPort serport, long tmout)
          Constructor
 
Method Summary
 void defineIO(int outputs)
          Define I/O lines
 int readConfiguration()
          Read Configuration
 int readInputs()
          Read Input Bits
 void setOutput(int newState)
          Set Output lines
 void setOutputBits(int newBits, int bitMask)
          Set a subset of output bits
 void setPwrupState(int pwrupState)
          Set Power-up state
 
Methods inherited from class org.mbari.siam.devices.bbElec.BBElec
cmdWith16bitReply, cmdWith16bitReply, cmdWith32bitReply, cmdWith32bitReply, inFlush, readResponse, readResponse, readResponse, send16bitCmd, sendCmd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET_OUTPUT

protected static byte[] SET_OUTPUT

READ_INPUT

protected static byte[] READ_INPUT

READ_CONFIG

protected static byte[] READ_CONFIG

DEFINE_IO

protected static byte[] DEFINE_IO

SET_PWRUP

protected static byte[] SET_PWRUP

_outputState

protected int _outputState
Constructor Detail

BB232SDD16

public BB232SDD16(gnu.io.SerialPort serport,
                  long tmout)
           throws java.io.IOException
Constructor

Parameters:
serport - Serial port to use for device
tmout - Read timeout in ms
Throws:
java.io.IOException

BB232SDD16

public BB232SDD16(gnu.io.SerialPort serport)
           throws java.io.IOException
Constructor

Parameters:
serport - Serial port to use for device
Throws:
java.io.IOException
Method Detail

defineIO

public void defineIO(int outputs)
              throws java.io.IOException
Define I/O lines

Parameters:
outputs - Bit vector, '1' defines output bit, '0' defines input bit
Throws:
java.io.IOException

setOutput

public void setOutput(int newState)
               throws java.io.IOException
Set Output lines

Parameters:
newState - State of output lines to set
Throws:
java.io.IOException

setOutputBits

public void setOutputBits(int newBits,
                          int bitMask)
                   throws java.io.IOException
Set a subset of output bits

Parameters:
newBits - State of output lines to set
bitMask - Mask for which bits to set
Throws:
java.io.IOException

setPwrupState

public void setPwrupState(int pwrupState)
                   throws java.io.IOException
Set Power-up state

Parameters:
pwrupState - State of output lines when device powers up
Throws:
java.io.IOException

readInputs

public int readInputs()
               throws java.io.IOException
Read Input Bits

Throws:
java.io.IOException

readConfiguration

public int readConfiguration()
                      throws java.io.IOException
Read Configuration

Returns:
I/O Definition in bits 31:16, Powerup state in bits 15:0
Throws:
java.io.IOException


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.