Class GPIBDevice

java.lang.Object
org.episteme.core.device.GPIBDevice
All Implemented Interfaces:
Serializable, AutoCloseable, Device, Commented, ComprehensiveIdentification, Identified<Identification>, Named

public abstract class GPIBDevice extends Object implements Device
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:
  • Field Details

    • gpibAddress

      protected int gpibAddress
    • boardIndex

      protected int boardIndex
    • connected

      protected boolean connected
    • name

      protected String name
    • manufacturer

      protected String manufacturer
    • firmware

      protected String firmware
    • traits

      protected final Map<String,Object> traits
  • Constructor Details

    • GPIBDevice

      protected GPIBDevice(String name, int gpibAddress)
    • GPIBDevice

      protected GPIBDevice(String name, int gpibAddress, int boardIndex)
  • Method Details

    • getGpibAddress

      public int getGpibAddress()
      Returns the GPIB address (0-30).
    • getBoardIndex

      public int getBoardIndex()
      Returns the GPIB board/controller index.
    • write

      public abstract void write(String command) throws IOException
      Sends a GPIB command string to the device.
      Parameters:
      command - the SCPI/GPIB command
      Throws:
      IOException - if communication fails
    • read

      public abstract String read() throws IOException
      Reads a response from the device.
      Returns:
      the response string
      Throws:
      IOException - if communication fails
    • query

      public String query(String command) throws IOException
      Writes a command and reads the response (query).
      Parameters:
      command - the query command
      Returns:
      the response
      Throws:
      IOException - if communication fails
    • getIdentification

      public String getIdentification() throws IOException
      Sends the standard *IDN? identification query.
      Returns:
      the device identification string
      Throws:
      IOException - if communication fails
    • reset

      public void reset() throws IOException
      Resets the device using *RST command.
      Throws:
      IOException - if communication fails
    • clearStatus

      public void clearStatus() throws IOException
      Clears device status using *CLS command.
      Throws:
      IOException - if communication fails
    • getName

      public String getName()
      Specified by:
      getName in interface ComprehensiveIdentification
      Specified by:
      getName in interface Named
    • getId

      public Identification getId()
      Description copied from interface: Device
      Returns the unique identifier for this device.
      Specified by:
      getId in interface Device
      Specified by:
      getId in interface Identified<Identification>
      Returns:
      the device ID
    • getTraits

      public Map<String,Object> getTraits()
      Description copied from interface: ComprehensiveIdentification
      Returns the traits map for this entity.
      Specified by:
      getTraits in interface Commented
      Specified by:
      getTraits in interface ComprehensiveIdentification
      Returns:
      the traits map
    • getManufacturer

      public String getManufacturer()
      Description copied from interface: Device
      Returns the manufacturer name.
      Specified by:
      getManufacturer in interface Device
      Returns:
      the manufacturer
    • getFirmware

      public String getFirmware()
      Description copied from interface: Device
      Returns the firmware version of this device.
      Specified by:
      getFirmware in interface Device
      Returns:
      the firmware version, or "N/A" if not applicable
    • isConnected

      public boolean isConnected()
      Description copied from interface: Device
      Checks if the device is currently connected.
      Specified by:
      isConnected in interface Device
      Returns:
      true if connected, false otherwise
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception