public class Maq20
extends org.lsst.ccs.drivers.modbus.Modbus
| Modifier and Type | Class and Description |
|---|---|
static class |
Maq20.ModuleType
Public constants.
|
org.lsst.ccs.drivers.modbus.Modbus.ConnTypeorg.lsst.ccs.drivers.ascii.Ascii.DataBits, org.lsst.ccs.drivers.ascii.Ascii.FlowCtrl, org.lsst.ccs.drivers.ascii.Ascii.Option, org.lsst.ccs.drivers.ascii.Ascii.Parity, org.lsst.ccs.drivers.ascii.Ascii.StopBits, org.lsst.ccs.drivers.ascii.Ascii.Terminator| Constructor and Description |
|---|
Maq20()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearBrownoutFlag(int modId)
Clears the brownout reset flag for a module.
|
void |
clearDacErrorCount(int modId)
Clears the DAC error count for a module.
|
void |
clearI2cErrorCounts(int modId)
Clears the I2C error counts for a module.
|
void |
clearNumericErrorCount(int modId)
Clears the numeric error count for a module.
|
void |
clearUartRxErrorCounts(int modId)
Clears the UART RX error counts for a module.
|
void |
clearWatchdogFlag(int modId)
Clears the watchdog reset flag for a module.
|
void |
close()
Closes the connection
|
Maq20AnalogIn |
getAnalIn(int modId)
Gets the analog input object for a module.
|
Maq20Analog |
getAnalog(int modId)
Gets the common analog object for a module.
|
Maq20AnalogOut |
getAnalOut(int modId)
Gets the analog output object for a module.
|
int |
getBrownoutFlag(int modId)
Gets the brownout reset flag for a module.
|
int |
getDacErrorCount(int modId)
Gets the DAC error count for a module.
|
String |
getDateCode(int modId)
Gets the date code.
|
Maq20DiscreteFreq |
getDiscFreq(int modId)
Gets the discrete frequency object for a module.
|
Maq20DiscreteIn |
getDiscIn(int modId)
Gets the discrete input object for a module.
|
Maq20DiscreteOut |
getDiscOut(int modId)
Gets the discrete output object for a module.
|
Maq20DiscretePulse |
getDiscPulse(int modId)
Gets the discrete pulse object for a module.
|
Maq20DiscretePWM |
getDiscPWM(int modId)
Gets the discrete PWM object for a module.
|
Maq20Discrete |
getDiscrete(int modId)
Gets the common discrete object for a module.
|
String |
getFwRevision(int modId)
Gets the firmware revision number.
|
int[] |
getI2cErrorCounts(int modId)
Gets the I2C error counts for a module.
|
String |
getIPAddress()
Gets the IP address.
|
int |
getModuleId(String serial)
Gets a module's ID, given its serial number.
|
int[] |
getModuleIds()
Gets all valid module IDs.
|
String |
getModuleName(int modId)
Gets the module name.
|
int |
getModuleOpType(int modId)
Gets the module operation type.
|
static int |
getModuleOpType(Maq20.ModuleType modType)
Gets the module operation type.
|
Maq20.ModuleType |
getModuleType(int modId)
Gets the module type.
|
int |
getNumericErrorCount(int modId)
Gets the numeric error count for a module.
|
int |
getNumInputs(int modId)
Gets the number of input channels for a module.
|
int |
getNumOutputs(int modId)
Gets the number of output channels for a module.
|
String |
getSerialNumber(int modId)
Gets the serial number.
|
String |
getSubnetMask()
Gets the subnet mask.
|
int[] |
getUartRxErrorCounts(int modId)
Gets the UART RX error counts for a module.
|
int |
getWatchdogFlag(int modId)
Gets the watchdog reset flag for a module.
|
void |
identifyModule(int modId)
Identifies a module.
|
void |
initSimulation(Maq20.ModuleType[] modTypes,
String[] serials)
Initializes the simulation.
|
boolean |
moduleExists(int modId)
Tests whether a module exists.
|
void |
open(org.lsst.ccs.drivers.modbus.Modbus.ConnType type,
String ident,
int parm1,
int parm2)
Opens a connection to the device.
|
void |
openUsb(String serialNum)
Opens a USB serial connection.
|
int |
readRegister(short addr)
Reads a register.
|
int |
readRegisterPair(short addr)
Reads an integer from a pair of registers in big-endian order.
|
short[] |
readRegisters(short addr,
short count)
Reads a set of registers.
|
short[] |
readRegisters(short sAddr,
short addr,
short count)
Reads a set of registers, overwriting Modbus version.
|
double |
readTemperature()
Reads the board temperature.
|
void |
register(String... serial)
Registers the modules.
|
void |
resetModule(int modId,
boolean deflt)
Resets a module.
|
void |
saveParameters()
Saves the board parameters.
|
void |
saveParameters(int modId)
Saves the parameters for a module.
|
void |
setAddressMode(boolean mode)
Sets whether entity numbers are direct addresses.
|
void |
setIPAddress(String ipAddr)
Sets the IP address.
|
void |
setSimChannelValue(int modId,
int chan,
double value)
Sets a simulated channel value.
|
void |
setSubnetMask(String mask)
Sets the subnet mask.
|
void |
writeRegister(short addr,
short value)
Writes a single register.
|
void |
writeRegister(short sAddr,
short addr,
short value)
Writes a single register, overwriting Modbus version.
|
void |
writeRegisterPair(short addr,
int value)
Writes an integer to a pair of registers in big-endian order.
|
void |
writeRegisters(short addr,
short[] value)
Writes a set of registers.
|
void |
writeRegisters(short sAddr,
short addr,
short[] value)
Writes a set of registers, overwriting Modbus version.
|
isAddressMode, open, open, open, readCoils, readDiscretes, readInputs, setExceptionMap, writeCoil, writeCoilscloseSilent, flush, getConnTimeout, getTimeout, isDropEcho, isOpen, makeDataCharacteristics, open, open, openFtdi, openFtdi, openFtdi, openNet, openNet, openSerial, openSerial, openSerial, read, read, readBytes, readBytes, setCommandTerm, setConnTimeout, setConnTimeout, setDefaultBaud, setDefaultParm, setDefaultPort, setMultidrop, setOptions, setResponseTerm, setTerminator, setTimeout, setTimeout, write, writeBytes, writeBytespublic static final int NUM_MODULES
public static final int OPER_ANALOG
public static final int OPER_ANALOUT
public static final int OPER_DISCRETE
public static final int OPER_DISCIN
public static final int OPER_DISCOUT
public static final short SLAVE_ADDR
public static final short MODU_ADDR_INCR
public static final short DEV_NAME_ADDR
public static final short DEV_NAME_LENG
public static final short SER_NUM_ADDR
public static final short SER_NUM_LENG
public static final short DATE_CODE_ADDR
public static final short DATE_CODE_LENG
public static final short FW_REVN_ADDR
public static final short FW_REVN_LENG
public static final short IP_ADDRESS_ADDR
public static final short IP_ADDRESS_LENG
public static final short SUBNET_MASK_ADDR
public static final short SAVE_PARMS_ADDR
public static final short MODU_DETECT_ADDR
public static final short RESET_ADDR
public static final short MODU_STATUS_ADDR
public static final short REGN_SN_ID_ADDR
public static final short AUTO_REGN_ADDR
public static final short SAVE_REGN_ADDR
public static final short DEL_REGN_ADDR
public static final short TEMPERATURE_ADDR
public static final short NUM_INP_CHANS_ADDR
public static final short NUM_OUT_CHANS_ADDR
public static final short SAVE_MODU_PARMS_ADDR
public static final short RANGE_COUNT_ADDR
public static final short RANGE_DATA_ADDR
public static final short RANGE_DATA_INCR
public static final short ENG_NFS_OFFS
public static final short ENG_PFS_OFFS
public static final short ENG_FS_PWR_OFFS
public static final short CNT_NFS_OFFS
public static final short CNT_PFS_OFFS
public static final short NUM_CHANNELS
public static final short WATCHDOG_FLAG_ADDR
public static final short BROWNOUT_FLAG_ADDR
public static final short I2C_ERRORS_ADDR
public static final short NUM_I2C_ERRORS
public static final short I2C_TX_ERROR_OFFS
public static final short I2C_RX_ERROR_OFFS
public static final short DAC_ERROR_ADDR
public static final short NUMERIC_ERROR_ADDR
public static final short UART_RX_ERRORS_ADDR
public static final short NUM_UART_RX_ERRORS
public static final short UART_RX_TOO_SHORT_OFFS
public static final short UART_RX_TOO_LONG_OFFS
public static final short UART_RX_INV_STATE_OFFS
public void open(org.lsst.ccs.drivers.modbus.Modbus.ConnType type,
String ident,
int parm1,
int parm2)
throws org.lsst.ccs.drivers.commons.DriverException
open in class org.lsst.ccs.drivers.modbus.Modbustype - The type of connection to makeident - The device identifier:
host name or IP address for network;
port name for serialparm1 - The first device parameter:
port number for network;
baud rate for serialparm2 - The second device parameter:
unused for network;
data characteristics for serialorg.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
close in class org.lsst.ccs.drivers.ascii.Asciiorg.lsst.ccs.drivers.commons.DriverExceptionpublic void openUsb(String serialNum) throws org.lsst.ccs.drivers.commons.DriverException
serialNum - The COM module serial numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic void setAddressMode(boolean mode)
setAddressMode in class org.lsst.ccs.drivers.modbus.Modbusmode - Whether or not address mode is to be setpublic short[] readRegisters(short addr,
short count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addresscount - The number of registers to readorg.lsst.ccs.drivers.commons.DriverExceptionpublic int readRegister(short addr)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressorg.lsst.ccs.drivers.commons.DriverExceptionpublic int readRegisterPair(short addr)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addressorg.lsst.ccs.drivers.commons.DriverExceptionpublic short[] readRegisters(short sAddr,
short addr,
short count)
throws org.lsst.ccs.drivers.commons.DriverException
readRegisters in class org.lsst.ccs.drivers.modbus.ModbussAddr - The slave addressaddr - The first register addresscount - The number of registers to readorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegister(short addr,
short value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressvalue - The value to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegisters(short addr,
short[] value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addressvalue - The array of values to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegisterPair(short addr,
int value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addressvalue - The integer to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegister(short sAddr,
short addr,
short value)
throws org.lsst.ccs.drivers.commons.DriverException
writeRegister in class org.lsst.ccs.drivers.modbus.ModbussAddr - The slave addressaddr - The register addressvalue - The value to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegisters(short sAddr,
short addr,
short[] value)
throws org.lsst.ccs.drivers.commons.DriverException
writeRegisters in class org.lsst.ccs.drivers.modbus.ModbussAddr - The slave addressaddr - The first register addressvalue - The array of values to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic boolean moduleExists(int modId)
modId - The module registration IDpublic String getModuleName(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20.ModuleType getModuleType(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getModuleOpType(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic static int getModuleOpType(Maq20.ModuleType modType)
modType - The module typepublic String getSerialNumber(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic String getDateCode(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic String getFwRevision(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic String getIPAddress() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setIPAddress(String ipAddr) throws org.lsst.ccs.drivers.commons.DriverException
ipAddr - The IP address, as an IP stringorg.lsst.ccs.drivers.commons.DriverExceptionpublic String getSubnetMask() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setSubnetMask(String mask) throws org.lsst.ccs.drivers.commons.DriverException
mask - The subnet mask, as an IP stringorg.lsst.ccs.drivers.commons.DriverExceptionpublic double readTemperature()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void saveParameters()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void register(String... serial) throws org.lsst.ccs.drivers.commons.DriverException
serial - The serial numbers of all the modules, in the desired orderorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getModuleId(String serial) throws org.lsst.ccs.drivers.commons.DriverException
serial - The module's serial numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic int[] getModuleIds()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int getNumInputs(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getNumOutputs(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void identifyModule(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void saveParameters(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void resetModule(int modId,
boolean deflt)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDdeflt - If true, reset to defaultsorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getWatchdogFlag(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void clearWatchdogFlag(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getBrownoutFlag(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void clearBrownoutFlag(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int[] getI2cErrorCounts(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void clearI2cErrorCounts(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getDacErrorCount(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void clearDacErrorCount(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getNumericErrorCount(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void clearNumericErrorCount(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic int[] getUartRxErrorCounts(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void clearUartRxErrorCounts(int modId)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20AnalogIn getAnalIn(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20AnalogOut getAnalOut(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20Analog getAnalog(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20DiscreteIn getDiscIn(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20DiscreteOut getDiscOut(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20Discrete getDiscrete(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20DiscreteFreq getDiscFreq(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20DiscretePulse getDiscPulse(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic Maq20DiscretePWM getDiscPWM(int modId) throws org.lsst.ccs.drivers.commons.DriverException
modId - The module registration IDorg.lsst.ccs.drivers.commons.DriverExceptionpublic void initSimulation(Maq20.ModuleType[] modTypes, String[] serials)
modTypes - The array of enumerated module typesserials - The array of corresponding serial numberspublic void setSimChannelValue(int modId,
int chan,
double value)
throws org.lsst.ccs.drivers.commons.DriverException
modId - The module IDchan - The channel numbervalue - The value to setorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2024 LSST. All rights reserved.