org.mbari.siam.foce.devices.elmo.base
Class ElmoService

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.mbari.siam.core.DeviceService
                  extended by org.mbari.siam.core.BaseInstrumentService
                      extended by org.mbari.siam.core.PolledInstrumentService
                          extended by org.mbari.siam.foce.devices.elmo.base.ElmoService
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, ScheduleOwner, Device, ElmoIF, DeviceServiceIF, Instrument, InstrumentDataListener
Direct Known Subclasses:
ElmoLouver, ElmoThruster

public class ElmoService
extends PolledInstrumentService
implements Instrument, InstrumentDataListener, ElmoIF

See Also:
Serialized Form

Nested Class Summary
 class ElmoService.Attributes
           
 
Field Summary
 ElmoService.Attributes _attributes
          Service attributes
protected  ElmoImpl _elmo
          Elmo implementation
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected  int _precision
           
static java.lang.String CLOSED_LOOP
           
static int DEFAULT_COUNTS_PER_REVOLUTION
           
protected static int DEFAULT_PRECISION
           
protected  java.text.DecimalFormat df
          DecimalFormat for number output formatting
protected  int DFL_CURRENT_LIMIT_MILLIAMPS
           
protected  int DFL_MAX_SAMPLE_BYTES
           
protected static int MAX_PRECISION
           
protected static int MIN_PRECISION
           
static java.lang.String OPEN_LOOP
           
static long serialVersionUID
          serial version, for Serializable interface
 
Fields inherited from class org.mbari.siam.core.BaseInstrumentService
_defaultSamplerTask, _defaultSampleScheduleName, _errorCache, _instrumentAttributes, _lastPacket, _lastSensorDataPacket, _maxSampleBytes, _messagePacket, _nPowerRequests, _nWakeRequests, _packetLog, _recordType, _running, _samplerWakeupTime, _scheduleKey, _schedules, _sensorDataPacket, _turbinator, MAX_BASE_RECORDTYPE, RECORDTYPE_DEFAULT, RECORDTYPE_METADATA, RECORDTYPE_UNDEFINED
 
Fields inherited from class org.mbari.siam.core.DeviceService
_fromDevice, _instrumentPort, _nodeProperties, _parentNode, _regEntry, _sandBox, _serviceCachePath, _serviceName, _servicePropertiesPath, _serviceXMLPath, _toDevice, CACHED_PROPERTIES_FILENAME, PROPERTIES_FILENAME, XML_FILENAME
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.mbari.siam.distributed.Device
ERROR, INITIAL, INSTRUMENT_STATE, MDATA_ALL, OK, SAFE, SAMPLING, SERVICE_ATTRIBUTES, SERVICE_CACHE, SERVICE_PROPERTIES, SERVICE_XML, SHUTDOWN, SLEEPING, SUSPEND, UNKNOWN
 
Constructor Summary
ElmoService()
           
 
Method Summary
 void beginMotion()
          start motion using current settings n
 double counts2orpm(int counts)
          Convert output shaft speed (counts/sec) to (rpm) (at output after gear train) (using gear ratio and counts per revolution)
 double counts2rpm(int counts)
          Convert motor speed (counts/sec) to (rpm) (before gear train) (using countsPerRevolution)
protected  ScheduleSpecifier createDefaultSampleSchedule()
          required by PolledInstrumentService
 void dataCallback(DevicePacket sensorData, PacketParser.Field[] fields)
          dataCallback from the sensors.
 void delay(long delayMsec)
          delay for specified number of milliseconds
 int getCountsPerRevolution()
          Get commutation counts per motor revolution.
 int getEncoderVelocity()
          get motor feedback velocity in counts/sec.
 int getEncoderVelocity(int nSamples)
          get (average of nSamples) motor feedback velocity in counts/sec.
 int getFaultRegister()
          return detailed motor fault information.
 double getGearRatio()
          Get the gear ratio between the motor and the output shaft.
protected  byte[] getInstrumentStateMetadata()
          Get device-specific metadata (e.g.
 int getJoggingVelocity()
          get motor jogging (commanded) velocity in counts/sec.
 long getPositionCounter()
          Get motor position counter for position modes
 long getPositionError()
          Get difference (counts) between commanded and actual position if available
 SerialPortParameters getSerialPortParameters()
          required by DeviceService
 int getStatusRegister()
          return motor status.
protected  PowerPolicy initCommunicationPowerPolicy()
          Return initial value of communication power policy.
protected  int initCurrentLimit()
          required by BaseInstrumentService
 void initializeController()
          Initialize motor controller
 void initializeController(int serialMode, int countsPerRevolution, double gearRatio, int mode, int acceleration, int deceleration, int stopDeceleration)
           
protected  void initializeInstrument()
          Override default initializeInstrument.
protected  PowerPolicy initInstrumentPowerPolicy()
          Return initial value of instrument power policy.
protected  int initInstrumentStartDelay()
          required by BaseInstrumentService
protected  int initMaxSampleBytes()
          required by BaseInstrumentService
protected  byte[] initPromptString()
          required by BaseInstrumentService
protected  byte[] initSampleTerminator()
          required by BaseInstrumentService
 boolean isEnabled()
          return motor enabled (MO) status.
 void jog(int counts)
          command motor velocity in counts/sec
 int orpm2counts(double rpm)
          Convert output shaft speed (rpm) to (counts/sec) (at output after gear train) (using gear ratio and counts per revolution)
 void ptpAbsolute(long position, boolean wait)
          Move motor to absolute position Motion may be subject to modulo position counting modes in effect.
 void ptpRelative(long distanceCounts, boolean wait)
          Move motor relative to current position
 java.lang.String readRegister(java.lang.String register)
          read an Elmo register value
protected  int readSample(byte[] sample)
          Override base class readSample (defined in BaseInstrumentService)
protected  void requestSample()
          required by BaseInstrumentService
 int rpm2counts(double rpm)
          Convert motor speed (rpm) to (counts/sec) (before gear train) (using countsPerRevolution)
 void serviceRegisteredCallback(RegistryEntry entry)
          Callback for InstrumentDataListener interface, called when service is registered with the InstrumentRegistry Fulfills InstrumentDataListener interface
 void setCountsPerRevolution(int value)
          Set commutation counts per motor revolution.
 void setEnable(boolean value, long timeoutMsec)
          start motion using current settings n
 void setGearRatio(double value)
          Set the gear ratio between the motor and the output shaft.
 void setJoggingVelocity(int counts)
          set motor velocity in counts Do not initiate motion
 void setPositionCounter(long positionCounts)
          Set motor position counter for position modes
 void setPTPSpeed(int counts)
          set motor PTP velocity (used for Absolute motion) in rpm Do not initiate motion
 void setSerialMode(int mode)
          Set serial port mode (MODE_SERIAL_LOCAL, MODE_SERIAL_RFC2217)
 java.lang.String showConfiguration()
          show current configuration information
protected  java.lang.String shutdownInstrument()
          Perform any instrument-specific shutdown actions and optionally return a human-readable message (e.g.
 int test()
          Self-test not implemented.
 void validateSpeed(int counts)
          Validate velocity value.
 
Methods inherited from class org.mbari.siam.core.PolledInstrumentService
acquire, doScheduledTask, setAttributes
 
Methods inherited from class org.mbari.siam.core.BaseInstrumentService
acquireSample, addDefaultPacketFilters, addSchedule, addSchedule, annotate, assertSamplingState, cacheProperties, callDataListeners, canSummarize, checkInputProperties, cleanupServiceState, clearDefaultPacketFilters, clearPropertiesCache, createPacketLog, createTask, createTurbinators, disableSummary, enableSummary, endDeviceAccess, getAllSchedules, getChildren, getCommunicationPowerPolicy, getCurrentLimit, getDefaultPacketFilters, getDefaultSampleSchedule, getDefaultSampleScheduleName, getDevicePacketParser, getFileBytes, getInstrumentPowerPolicy, getInstrumentServiceBlock, getInstrumentStartDelay, getLastSample, getMaxSampleBytes, getMaxSampleTries, getMetadata, getMetadata, getMetadataPayload, getPackets, getPackets, getParent, getParser, getPortDiagnostics, getPortDiagnosticsSummary, getPromptString, getProperties, getProperty, getSampleBuf, getSampleSchedule, getSampleTerminator, getSampleTimeout, getSchedule, getScheduleKey, getSchedules, getServicePropertiesBytes, initialize, initializeDriverDefaults, initializePooledResources, interruptDeviceAccess, logPacket, managePowerSleep, managePowerWake, nPowerRequests, postSample, powerOff, powerOffCallback, powerOn, powerOnCallback, prepareToRun, prepareToSample, printData, processSample, removeAllSchedules, removeSchedule, resetPortDiagnostics, resume, resumeSchedule, running, setClock, setClock, setCommunicationPowerPolicy, setCurrentLimit, setDefaultSampleScheduleName, setInstrumentPowerPolicy, setInstrumentServiceBlock, setInstrumentStartDelay, setMaxSampleBytes, setMaxSampleTries, setPromptString, setProperty, setRecordType, setSampleTerminator, setSampleTimeout, shutdown, sleepingUntil, snooze, startDeviceAccess, summaryEnabled, suspend, suspendSchedule, sync, syncSchedule, validateSample
 
Methods inherited from class org.mbari.siam.core.DeviceService
addDataListener, advertiseService, createRegistryEntry, getAttributes, getCommPortName, getFrameworkVersion, getId, getInstrumentPort, getLocation, getName, getRemoteSerialPort, getRemoteSerialPort, getSamplingCount, getSamplingErrorCount, getSamplingRetryCount, getStatus, host, incRetryCount, initializePropertyDefaults, registryEntry, registryName, removeDataListener, setInstrumentPort, setNodeProperties, setParent, setSerialPort, setStatusError, setStatusInitial, setStatusOk, setStatusSafe, setStatusSampling, setStatusShutdown, setStatusSuspend
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mbari.siam.distributed.Instrument
acquireSample, addDefaultPacketFilters, annotate, cacheProperties, clearDefaultPacketFilters, clearPropertiesCache, disableSummary, enableSummary, getDefaultPacketFilters, getLastSample, getPackets, getPackets, getParser, getPortDiagnostics, getPortDiagnosticsSummary, getProperties, getProperty, getSampleSchedule, getSchedules, resetPortDiagnostics, setClock, setClock, setProperty, summaryEnabled
 
Methods inherited from interface org.mbari.siam.distributed.Device
getChildren, getCommPortName, getFrameworkVersion, getId, getLocation, getMetadata, getName, getParent, getSamplingCount, getSamplingErrorCount, getSamplingRetryCount, getStatus, host, powerOff, powerOn, prepareToRun, resume, shutdown, suspend
 
Methods inherited from interface org.mbari.siam.distributed.DeviceServiceIF
getName
 
Methods inherited from interface org.mbari.siam.core.ScheduleOwner
addSchedule, getAllSchedules, getScheduleKey, removeAllSchedules, removeSchedule, resumeSchedule, sleepingUntil, suspendSchedule, syncSchedule
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Log4j logger


_attributes

public ElmoService.Attributes _attributes
Service attributes


serialVersionUID

public static final long serialVersionUID
serial version, for Serializable interface

See Also:
Constant Field Values

DFL_MAX_SAMPLE_BYTES

protected int DFL_MAX_SAMPLE_BYTES

DFL_CURRENT_LIMIT_MILLIAMPS

protected int DFL_CURRENT_LIMIT_MILLIAMPS

OPEN_LOOP

public static final java.lang.String OPEN_LOOP
See Also:
Constant Field Values

CLOSED_LOOP

public static final java.lang.String CLOSED_LOOP
See Also:
Constant Field Values

DEFAULT_COUNTS_PER_REVOLUTION

public static final int DEFAULT_COUNTS_PER_REVOLUTION
See Also:
Constant Field Values

_elmo

protected ElmoImpl _elmo
Elmo implementation


DEFAULT_PRECISION

protected static int DEFAULT_PRECISION

MIN_PRECISION

protected static int MIN_PRECISION

MAX_PRECISION

protected static int MAX_PRECISION

_precision

protected int _precision

df

protected java.text.DecimalFormat df
DecimalFormat for number output formatting

Constructor Detail

ElmoService

public ElmoService()
            throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

createDefaultSampleSchedule

protected ScheduleSpecifier createDefaultSampleSchedule()
                                                 throws ScheduleParseException
required by PolledInstrumentService

Specified by:
createDefaultSampleSchedule in class PolledInstrumentService
Throws:
ScheduleParseException

initMaxSampleBytes

protected int initMaxSampleBytes()
required by BaseInstrumentService

Specified by:
initMaxSampleBytes in class BaseInstrumentService

initPromptString

protected byte[] initPromptString()
required by BaseInstrumentService

Specified by:
initPromptString in class BaseInstrumentService

initSampleTerminator

protected byte[] initSampleTerminator()
required by BaseInstrumentService

Specified by:
initSampleTerminator in class BaseInstrumentService

initCurrentLimit

protected int initCurrentLimit()
required by BaseInstrumentService

Specified by:
initCurrentLimit in class BaseInstrumentService

initInstrumentPowerPolicy

protected PowerPolicy initInstrumentPowerPolicy()
Return initial value of instrument power policy.

Specified by:
initInstrumentPowerPolicy in class BaseInstrumentService

initCommunicationPowerPolicy

protected PowerPolicy initCommunicationPowerPolicy()
Return initial value of communication power policy.

Specified by:
initCommunicationPowerPolicy in class BaseInstrumentService

initInstrumentStartDelay

protected int initInstrumentStartDelay()
required by BaseInstrumentService

Specified by:
initInstrumentStartDelay in class BaseInstrumentService

getSerialPortParameters

public SerialPortParameters getSerialPortParameters()
                                             throws gnu.io.UnsupportedCommOperationException
required by DeviceService

Overrides:
getSerialPortParameters in class DeviceService
Throws:
gnu.io.UnsupportedCommOperationException

test

public int test()
Self-test not implemented.

Specified by:
test in interface Device

initializeInstrument

protected void initializeInstrument()
                             throws InitializeException,
                                    java.lang.Exception
Override default initializeInstrument.

Overrides:
initializeInstrument in class BaseInstrumentService
Throws:
InitializeException
java.lang.Exception

requestSample

protected void requestSample()
                      throws TimeoutException,
                             java.lang.Exception
required by BaseInstrumentService

Specified by:
requestSample in class PolledInstrumentService
Throws:
TimeoutException
java.lang.Exception

shutdownInstrument

protected java.lang.String shutdownInstrument()
                                       throws java.lang.Exception
Perform any instrument-specific shutdown actions and optionally return a human-readable message (e.g. noting caveats, status, etc); the returned message is purely for human operator. (override BaseInstrumentService)

Overrides:
shutdownInstrument in class BaseInstrumentService
Throws:
java.lang.Exception

getInstrumentStateMetadata

protected byte[] getInstrumentStateMetadata()
Get device-specific metadata (e.g. configuration, operating mode).

Overrides:
getInstrumentStateMetadata in class BaseInstrumentService

dataCallback

public void dataCallback(DevicePacket sensorData,
                         PacketParser.Field[] fields)
dataCallback from the sensors. Fulfills InstrumentDataListener interface

Specified by:
dataCallback in interface InstrumentDataListener
Parameters:
sensorData - - SensorDataPacket that instrument logged
fields - - Result of passing sensorData to PacketParser.parseFields() if registered DeviceService is an instanceof BaseInstrumentService. Else null.

serviceRegisteredCallback

public void serviceRegisteredCallback(RegistryEntry entry)
Callback for InstrumentDataListener interface, called when service is registered with the InstrumentRegistry Fulfills InstrumentDataListener interface

Specified by:
serviceRegisteredCallback in interface InstrumentDataListener

validateSpeed

public void validateSpeed(int counts)
                   throws java.lang.IllegalArgumentException
Validate velocity value. By default, does nothing and relies on the configured ElmoImpl limits. Subclasses may override this method to provide special range validatation logic. For example, a service may wish to impose constraints like a range that includes 0 rpm and 50-100 rpm, but no speeds between 0-50.

Throws:
java.lang.IllegalArgumentException

initializeController

public void initializeController()
                          throws TimeoutException,
                                 java.io.IOException,
                                 java.lang.Exception
Initialize motor controller

Specified by:
initializeController in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.Exception

initializeController

public void initializeController(int serialMode,
                                 int countsPerRevolution,
                                 double gearRatio,
                                 int mode,
                                 int acceleration,
                                 int deceleration,
                                 int stopDeceleration)
                          throws TimeoutException,
                                 java.io.IOException,
                                 java.lang.Exception
Specified by:
initializeController in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.Exception

rpm2counts

public int rpm2counts(double rpm)
               throws java.lang.Exception
Convert motor speed (rpm) to (counts/sec) (before gear train) (using countsPerRevolution)

Specified by:
rpm2counts in interface ElmoIF
Throws:
java.lang.Exception

counts2rpm

public double counts2rpm(int counts)
                  throws java.lang.Exception
Convert motor speed (counts/sec) to (rpm) (before gear train) (using countsPerRevolution)

Specified by:
counts2rpm in interface ElmoIF
Throws:
java.lang.Exception

orpm2counts

public int orpm2counts(double rpm)
                throws java.lang.Exception
Convert output shaft speed (rpm) to (counts/sec) (at output after gear train) (using gear ratio and counts per revolution)

Specified by:
orpm2counts in interface ElmoIF
Throws:
java.lang.Exception

counts2orpm

public double counts2orpm(int counts)
                   throws java.lang.Exception
Convert output shaft speed (counts/sec) to (rpm) (at output after gear train) (using gear ratio and counts per revolution)

Specified by:
counts2orpm in interface ElmoIF
Throws:
java.lang.Exception

setSerialMode

public void setSerialMode(int mode)
                   throws java.lang.IllegalArgumentException
Description copied from interface: ElmoIF
Set serial port mode (MODE_SERIAL_LOCAL, MODE_SERIAL_RFC2217)

Specified by:
setSerialMode in interface ElmoIF
Throws:
java.lang.IllegalArgumentException

setCountsPerRevolution

public void setCountsPerRevolution(int value)
                            throws java.lang.IllegalArgumentException
Description copied from interface: ElmoIF
Set commutation counts per motor revolution. Depends on motor type (number of poles, etc.)

Specified by:
setCountsPerRevolution in interface ElmoIF
Throws:
java.lang.IllegalArgumentException

getCountsPerRevolution

public int getCountsPerRevolution()
Description copied from interface: ElmoIF
Get commutation counts per motor revolution. Depends on motor type (number of poles, etc.)

Specified by:
getCountsPerRevolution in interface ElmoIF

setEnable

public void setEnable(boolean value,
                      long timeoutMsec)
               throws TimeoutException,
                      java.io.IOException,
                      java.lang.NullPointerException,
                      java.lang.IllegalArgumentException,
                      java.lang.Exception
start motion using current settings n

Specified by:
setEnable in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setGearRatio

public void setGearRatio(double value)
                  throws java.lang.IllegalArgumentException
Set the gear ratio between the motor and the output shaft. For example, if the output shaft turns 67.5 times slower than the motor, the gear ratio should be set to 67.5.

Specified by:
setGearRatio in interface ElmoIF
Throws:
java.lang.IllegalArgumentException

getGearRatio

public double getGearRatio()
Get the gear ratio between the motor and the output shaft. For example, if the output shaft turns 67.5 times slower than the motor, the gear ratio should be set to 67.5.

Specified by:
getGearRatio in interface ElmoIF

setPositionCounter

public void setPositionCounter(long positionCounts)
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.IllegalArgumentException,
                               java.lang.Exception
Set motor position counter for position modes

Specified by:
setPositionCounter in interface ElmoIF
Parameters:
positionCounts - new value of position counter (counts) fulfills ElmoIF interface
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getPositionCounter

public long getPositionCounter()
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.Exception
Get motor position counter for position modes

Specified by:
getPositionCounter in interface ElmoIF
Returns:
position counter (counts)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.Exception

getJoggingVelocity

public int getJoggingVelocity()
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.IllegalArgumentException,
                              java.lang.Exception
get motor jogging (commanded) velocity in counts/sec.

Specified by:
getJoggingVelocity in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getEncoderVelocity

public int getEncoderVelocity()
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.IllegalArgumentException,
                              java.lang.Exception
get motor feedback velocity in counts/sec.

Specified by:
getEncoderVelocity in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getEncoderVelocity

public int getEncoderVelocity(int nSamples)
                       throws TimeoutException,
                              java.io.IOException,
                              java.lang.NullPointerException,
                              java.lang.IllegalArgumentException,
                              java.lang.Exception
get (average of nSamples) motor feedback velocity in counts/sec.

Specified by:
getEncoderVelocity in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

isEnabled

public boolean isEnabled()
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.NullPointerException,
                         java.lang.IllegalArgumentException,
                         java.lang.Exception
return motor enabled (MO) status.

Specified by:
isEnabled in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getStatusRegister

public int getStatusRegister()
                      throws TimeoutException,
                             java.io.IOException,
                             java.lang.NullPointerException,
                             java.lang.IllegalArgumentException,
                             java.lang.Exception
return motor status.

Specified by:
getStatusRegister in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getFaultRegister

public int getFaultRegister()
                     throws TimeoutException,
                            java.io.IOException,
                            java.lang.NullPointerException,
                            java.lang.IllegalArgumentException,
                            java.lang.Exception
return detailed motor fault information.

Specified by:
getFaultRegister in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

getPositionError

public long getPositionError()
                      throws TimeoutException,
                             java.io.IOException,
                             java.lang.Exception
Get difference (counts) between commanded and actual position if available

Specified by:
getPositionError in interface ElmoIF
Returns:
position error (counts)
Throws:
TimeoutException
java.io.IOException
java.lang.Exception

setJoggingVelocity

public void setJoggingVelocity(int counts)
                        throws TimeoutException,
                               java.io.IOException,
                               java.lang.NullPointerException,
                               java.lang.IllegalArgumentException,
                               java.lang.Exception
set motor velocity in counts Do not initiate motion

Specified by:
setJoggingVelocity in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

setPTPSpeed

public void setPTPSpeed(int counts)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
set motor PTP velocity (used for Absolute motion) in rpm Do not initiate motion

Specified by:
setPTPSpeed in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

showConfiguration

public java.lang.String showConfiguration()
                                   throws TimeoutException,
                                          java.io.IOException,
                                          java.lang.NullPointerException,
                                          java.lang.IllegalArgumentException,
                                          java.lang.Exception
show current configuration information

Specified by:
showConfiguration in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

readRegister

public java.lang.String readRegister(java.lang.String register)
                              throws TimeoutException,
                                     java.io.IOException,
                                     java.lang.NullPointerException,
                                     java.lang.IllegalArgumentException,
                                     java.lang.Exception
read an Elmo register value

Specified by:
readRegister in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

beginMotion

public void beginMotion()
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
start motion using current settings n

Specified by:
beginMotion in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

jog

public void jog(int counts)
         throws TimeoutException,
                java.io.IOException,
                java.lang.NullPointerException,
                java.lang.IllegalArgumentException,
                java.lang.Exception
command motor velocity in counts/sec

Specified by:
jog in interface ElmoIF
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

ptpRelative

public void ptpRelative(long distanceCounts,
                        boolean wait)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Move motor relative to current position

Specified by:
ptpRelative in interface ElmoIF
Parameters:
distanceCounts - distance to move (counts)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

ptpAbsolute

public void ptpAbsolute(long position,
                        boolean wait)
                 throws TimeoutException,
                        java.io.IOException,
                        java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        java.lang.Exception
Move motor to absolute position Motion may be subject to modulo position counting modes in effect.

Specified by:
ptpAbsolute in interface ElmoIF
Parameters:
position - to move to (counts)
Throws:
TimeoutException
java.io.IOException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.Exception

delay

public void delay(long delayMsec)
delay for specified number of milliseconds

Specified by:
delay in interface ElmoIF
Parameters:
delayMsec - delay duration in milliseconds

readSample

protected int readSample(byte[] sample)
                  throws TimeoutException,
                         java.io.IOException,
                         java.lang.Exception
Override base class readSample (defined in BaseInstrumentService)

Overrides:
readSample in class BaseInstrumentService
Parameters:
sample - output buffer
Throws:
TimeoutException
java.io.IOException
java.lang.Exception


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.