Class GPIBDevice
java.lang.Object
org.episteme.core.device.GPIBDevice
- All Implemented Interfaces:
Serializable, AutoCloseable, Device, Commented, ComprehensiveIdentification, Identified<Identification>, Named
Abstract base class for GPIB (IEEE-488) devices.
GPIB (General Purpose Interface Bus) is a standard for connecting laboratory instruments to computers. This class provides the foundation for GPIB device communication.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Device
Device.Record, Device.Status -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGPIBDevice(String name, int gpibAddress) protectedGPIBDevice(String name, int gpibAddress, int boardIndex) -
Method Summary
Modifier and TypeMethodDescriptionvoidClears device status using *CLS command.voidclose()intReturns the GPIB board/controller index.Returns the firmware version of this device.intReturns the GPIB address (0-30).getId()Returns the unique identifier for this device.Sends the standard *IDN?Returns the manufacturer name.getName()Returns the traits map for this entity.booleanChecks if the device is currently connected.Writes a command and reads the response (query).abstract Stringread()Reads a response from the device.voidreset()Resets the device using *RST command.abstract voidSends a GPIB command string to the device.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Commented
getComments, getTrait, setCommentsMethods inherited from interface ComprehensiveIdentification
getTrait, setName, setTraitMethods inherited from interface Device
calibrate, calibrate, connect, disconnect, getAccuracy, getCalibrationHistory, getCapabilities, getDeviceStatus, getDisplayUnit, getHistory, getLastCalibration, getLocationDescription, getMaxRange, getMeasurableQuantities, getMinRange, getModel, getPrecisionDescription, getReadings, getResolution, getSensitivity, getStatus, getValue, isEnabled, measure, needsCalibration, setDisplayUnit, setEnabled
-
Field Details
-
gpibAddress
protected int gpibAddress -
boardIndex
protected int boardIndex -
connected
protected boolean connected -
name
-
manufacturer
-
firmware
-
traits
-
-
Constructor Details
-
GPIBDevice
-
GPIBDevice
-
-
Method Details
-
getGpibAddress
public int getGpibAddress()Returns the GPIB address (0-30). -
getBoardIndex
public int getBoardIndex()Returns the GPIB board/controller index. -
write
Sends a GPIB command string to the device.- Parameters:
command- the SCPI/GPIB command- Throws:
IOException- if communication fails
-
read
Reads a response from the device.- Returns:
- the response string
- Throws:
IOException- if communication fails
-
query
Writes a command and reads the response (query).- Parameters:
command- the query command- Returns:
- the response
- Throws:
IOException- if communication fails
-
getIdentification
Sends the standard *IDN? identification query.- Returns:
- the device identification string
- Throws:
IOException- if communication fails
-
reset
Resets the device using *RST command.- Throws:
IOException- if communication fails
-
clearStatus
Clears device status using *CLS command.- Throws:
IOException- if communication fails
-
getName
- Specified by:
getNamein interfaceComprehensiveIdentification- Specified by:
getNamein interfaceNamed
-
getId
Description copied from interface:DeviceReturns the unique identifier for this device.- Specified by:
getIdin interfaceDevice- Specified by:
getIdin interfaceIdentified<Identification>- Returns:
- the device ID
-
getTraits
Description copied from interface:ComprehensiveIdentificationReturns the traits map for this entity.- Specified by:
getTraitsin interfaceCommented- Specified by:
getTraitsin interfaceComprehensiveIdentification- Returns:
- the traits map
-
getManufacturer
Description copied from interface:DeviceReturns the manufacturer name.- Specified by:
getManufacturerin interfaceDevice- Returns:
- the manufacturer
-
getFirmware
Description copied from interface:DeviceReturns the firmware version of this device.- Specified by:
getFirmwarein interfaceDevice- Returns:
- the firmware version, or "N/A" if not applicable
-
isConnected
public boolean isConnected()Description copied from interface:DeviceChecks if the device is currently connected.- Specified by:
isConnectedin interfaceDevice- Returns:
- true if connected, false otherwise
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-