|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.mbari.siam.core.DeviceService
org.mbari.siam.core.BaseInstrumentService
org.mbari.siam.core.PolledInstrumentService
org.mbari.siam.foce.devices.co2subsys.CO2SubsystemMonitor
public class CO2SubsystemMonitor
reads and writes the B&B 232SPDA module used to interface various analog and digital signals from within the CO2 electronics housing. It has seven 12-bit A/D inputs, four 8-bit D/A outputs, two digital inputs and one digital output. It is powered by +12Vdc and is communicated to via an RS-232 connection. It is serial port #yy and it's serial parameters are xxxx,x,x,x with xx hardware control. See appendicies for specific command structures. Analog In #0: Volt_24V This is a scaled version of the main +24Vdc bus. The input range is a DC voltage from 0 volts to 5 volts, which maps to an input voltage range of 0 to +30V. The defining equation is y (Bus volts) = 6.0x (ADC volts). Analog In #1: Curr_24V This is a representative voltage of the current used by the +24Vdc bus. The input range is a DC voltage from 0 volts to 5 volts, which maps to an input current range of 0 to 10A. The defining equation is y (Bus amps) = 2.0x (ADC volts). Analog In #2: HTM2530 Humidity This is the ambient humidity inside of the FOCE electronics can. It outputs a 1-4V signal which corresponds to 0-100% Relative Humidity (RH). The defining equation is y (%RH) = 37.5 x (ADC volts) - 37.5. Analog In #3: HTM2530 Temperature This is the ambient temperature inside of the FOCE electronics can. It outputs a 0 to 5V signal which corresponds to a -40 C to +125 C temperature range. There are two possible defining equations, a more precise third order polynomial and a simpler linear equation. The linear equation works sufficiently around our expected operating range but generates considerable errors at either extreme. Third Order: y = 7.689x^3-48.935x^2+137.49x-132.34 Linear: y = 40.944x - 73.787 where y is the measured temperature in degress Celsius x is the ADC volts Analog In #4: Fan State This signal is actually a digital input signal used to indicate the stae of the cooling fan. High = Fan OFF, Low = Fan ON. Analog In #5: Reserved for future use Analog In #6: Reserved for future use Digital In #0: Water Sensor #1 This is a digital input signal tied to water detector #1. A digital high indicates no water present, while a digital low indicates water in the housing. Digital In #1: Water Sensor #2 This is a digital input signal tied to water detector #2. A digital high indicates no water present, while a digital low indicates water in the housing. Digital Out #0: Fan Control This is a digital output signal used to control the state of the cooling fan. Setting this bit high activates the fan, while a low de-activates the fan. Analog Out #0-#3: Not Used These signals are not brought out to the Power Monitor Board.
| Field Summary | |
|---|---|
CO2SubsystemMonitorAttributes |
_attributes
Service attributes |
protected static org.apache.log4j.Logger |
_log4j
Log4j logger |
static int |
AD_BITS
|
static double |
AD_COUNTS
|
static short |
AD_MASK
|
static int |
ANALOG_IN_5
|
static int |
ANALOG_IN_6
|
static int |
CURRENT_24V
|
static int |
FAN_CONTROL
|
static int |
FAN_STATE
|
static int |
HUMIDITY
|
static int |
TEMPERATURE
|
static int |
VOLTAGE_24V
|
static double |
VREF
|
static int |
WATER_SENSOR_1
|
static int |
WATER_SENSOR_2
|
| 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 |
| Fields inherited from interface org.mbari.siam.distributed.devices.CO2SubsystemMonitorIF |
|---|
FAN_CONTROL_OFF, FAN_CONTROL_ON |
| Constructor Summary | |
|---|---|
CO2SubsystemMonitor()
Zero-arg constructor |
|
| Method Summary | |
|---|---|
protected double[] |
convertData(short[] rawData)
|
protected double |
counts2volts(short counts)
|
protected ScheduleSpecifier |
createDefaultSampleSchedule()
required by PolledInstrumentService |
void |
dataCallback(DevicePacket sensorData,
PacketParser.Field[] fields)
dataCallback from the sensors. |
PacketParser.Field[] |
getMonitorState()
Read the monitor state, but do not log the sample |
PacketParser |
getParser()
Return a PacketParser (create one if an instance doesn't exist). |
SerialPortParameters |
getSerialPortParameters()
required by DeviceService |
protected PowerPolicy |
initCommunicationPowerPolicy()
required by BaseInstrumentService |
protected int |
initCurrentLimit()
required by BaseInstrumentService |
protected void |
initializeInstrument()
Register us for data callbacks from the temperature device |
protected PowerPolicy |
initInstrumentPowerPolicy()
required by BaseInstrumentService |
protected int |
initInstrumentStartDelay()
required by BaseInstrumentService |
protected int |
initMaxSampleBytes()
required by BaseInstrumentService |
protected byte[] |
initPromptString()
required by BaseInstrumentService |
protected byte[] |
initSampleTerminator()
required by BaseInstrumentService |
java.lang.Object |
parseDataPacket(SensorDataPacket pkt)
Parse a SensorDataPacket into a double[] array (used by infrastructure) |
protected int |
readSample(byte[] sample)
Read raw sample bytes from serial port into buffer, return number of bytes read. |
protected void |
requestSample()
required by BaseInstrumentService |
void |
serviceRegisteredCallback(RegistryEntry entry)
Callback for InstrumentDataListener interface, called when service is registered with the InstrumentRegistry Fulfills InstrumentDataListener interface |
void |
setFanControl(int state)
Set the CO2 cooling fan control bit. |
int |
test()
Self-test not implemented. |
| Methods inherited from class org.mbari.siam.core.PolledInstrumentService |
|---|
acquire, doScheduledTask, setAttributes |
| 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, 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 |
|---|
protected static org.apache.log4j.Logger _log4j
public static final int VOLTAGE_24V
public static final int CURRENT_24V
public static final int HUMIDITY
public static final int TEMPERATURE
public static final int FAN_STATE
public static final int ANALOG_IN_5
public static final int ANALOG_IN_6
public static final int WATER_SENSOR_1
public static final int WATER_SENSOR_2
public static final int FAN_CONTROL
public static final int AD_BITS
public static final double AD_COUNTS
public static final short AD_MASK
public static final double VREF
public CO2SubsystemMonitorAttributes _attributes
| Constructor Detail |
|---|
public CO2SubsystemMonitor()
throws java.rmi.RemoteException
java.rmi.RemoteException| Method Detail |
|---|
public int test()
test in interface Deviceprotected ScheduleSpecifier createDefaultSampleSchedule()
createDefaultSampleSchedule in class PolledInstrumentService
protected void requestSample()
throws java.lang.Exception
requestSample in class PolledInstrumentServicejava.lang.Exceptionprotected PowerPolicy initInstrumentPowerPolicy()
initInstrumentPowerPolicy in class BaseInstrumentServiceprotected PowerPolicy initCommunicationPowerPolicy()
initCommunicationPowerPolicy in class BaseInstrumentServiceprotected int initMaxSampleBytes()
initMaxSampleBytes in class BaseInstrumentServiceprotected byte[] initPromptString()
initPromptString in class BaseInstrumentServiceprotected byte[] initSampleTerminator()
initSampleTerminator in class BaseInstrumentServiceprotected int initCurrentLimit()
initCurrentLimit in class BaseInstrumentServiceprotected int initInstrumentStartDelay()
initInstrumentStartDelay in class BaseInstrumentService
public SerialPortParameters getSerialPortParameters()
throws gnu.io.UnsupportedCommOperationException
getSerialPortParameters in class DeviceServicegnu.io.UnsupportedCommOperationException
protected void initializeInstrument()
throws InitializeException,
java.lang.Exception
initializeInstrument in class BaseInstrumentServiceInitializeException
java.lang.Exceptionprotected double counts2volts(short counts)
protected double[] convertData(short[] rawData)
protected int readSample(byte[] sample)
throws TimeoutException,
java.io.IOException,
java.lang.Exception
BaseInstrumentService
readSample in class BaseInstrumentServicesample - output buffer
TimeoutException
java.io.IOException
java.lang.Exception
public PacketParser getParser()
throws NotSupportedException
getParser in interface InstrumentgetParser in class BaseInstrumentServiceNotSupportedException
public java.lang.Object parseDataPacket(SensorDataPacket pkt)
throws InvalidDataException
InvalidDataException
public void setFanControl(int state)
throws java.lang.Exception
setFanControl in interface CO2SubsystemMonitorIFjava.lang.Exception
public PacketParser.Field[] getMonitorState()
throws java.lang.Exception
getMonitorState in interface CO2SubsystemMonitorIFjava.lang.Exception
public void dataCallback(DevicePacket sensorData,
PacketParser.Field[] fields)
dataCallback in interface InstrumentDataListenersensorData - - SensorDataPacket that instrument loggedfields - - Result of passing sensorData to PacketParser.parseFields()
if registered DeviceService is an instanceof BaseInstrumentService. Else null.public void serviceRegisteredCallback(RegistryEntry entry)
serviceRegisteredCallback in interface InstrumentDataListener
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||