|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charly.client.ChGpibClient
This class represents the GPIB-bus. This class will in the future be
deprecated. Please use ChGpibUnit
and ChGpibSrq
instead.
ChGpibClient
offers the methods provided
by the Keithley CEC.488 API to each client. Before calling these
methods a ChTask
with the appropriate resources (the GPIB-devices
or the whole GPIB-bus) has to
be started.
Field Summary | |
protected ChGpibDevice |
gpibDvc
|
protected java.util.LinkedList |
gpibListeners
elems are of type ChGpibListener . |
protected ChGpibClientRepresentation |
representation
|
protected ChTask |
task
|
Constructor Summary | |
ChGpibClient()
Konstruktor, der ChGpibClient(ChConnect) mittels new ChConnect() aufruft und daher eine Verbindung mit dem voreingestellten Server aufbaut |
|
ChGpibClient(ChConnect conn)
Konstruktor |
Method Summary | |
void |
addGpibListener(ChGpibListener l)
adds a ChGpibListener for SRQ-Events. |
void |
checkSrq(int dvcAddr)
causes the server to check the given device on srq and to send an event to the ChGpibListener. |
byte[] |
enter(int dvcAddr)
receives from a given device on the gpib-bus. |
void |
fireSRQEvent(int dvcAddr)
for internal use only. |
static java.lang.String |
getResourceName(int dvcAddr)
returns the name to be allocated on a server for a specified GPIB-device. |
ChTask |
getTask()
|
void |
initialize(int addr,
int level)
usually does not need to be called. |
int |
isGpibBoardPresent()
tests if gpibboard is present. |
int |
isListenerPresent(int dvcAddr)
tests if listener with specified address is present. |
int |
ppoll()
Deprecated. Please use new event listener model. |
byte[] |
rarray()
receives binary and non-binary data from the gpib-bus. |
byte[] |
rarray(int dvcAddr)
receives binary and non-binary data from a specified device of the gpib-bus. |
byte[] |
receive()
receives non-binary data from the gpib-bus. |
byte[] |
receive(int dvcAddr)
receives non-binary data from the gpib-bus. |
void |
removeGpibListener(ChGpibListener l)
|
void |
send(int dvcAddr,
byte[] data,
int length)
sends a specified string to a given device on the gpib-bus. |
void |
send(int dvcAddr,
java.lang.String data)
sends a specified string to a given device on the gpib-bus. |
void |
setTask(ChTask task)
This method must be called to be able to use the other methods. |
void |
setTimeOut(int msec)
sets timeout-time of the GPIB-Bus in msec. |
int |
spoll(int dvcAddr)
Deprecated. Please use new event listener model. |
int |
srq()
Deprecated. Please use new event listener model. |
void |
tarray(byte[] data,
int length,
byte eoi)
sends data to the gpib-bus. |
void |
tarray(int dvcAddr,
byte[] data,
int length,
byte eoi)
sends data to a given device of the gpib-bus. |
void |
transmit(byte[] data,
int length)
sends commands and data to the gpib-bus. |
void |
uncheckSrq(int dvcAddr)
This method should be used to inform the server that he does not have to check the device on an SRQ. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ChGpibDevice gpibDvc
protected ChTask task
protected ChGpibClientRepresentation representation
protected java.util.LinkedList gpibListeners
ChGpibListener
.
Constructor Detail |
public ChGpibClient() throws java.rmi.RemoteException, java.net.MalformedURLException, java.rmi.NotBoundException
ChGpibClient(ChConnect)
,
ChConnect
public ChGpibClient(ChConnect conn) throws java.rmi.RemoteException, java.net.MalformedURLException, java.rmi.NotBoundException
Method Detail |
public void fireSRQEvent(int dvcAddr)
fireSRQEvent
in interface ChGpibClientIntern
ChGpibClientRepresentation
,
ChGpibClientIntern
public void addGpibListener(ChGpibListener l)
checkSrq(int)
public void removeGpibListener(ChGpibListener l)
public void setTask(ChTask task)
public ChTask getTask()
public void initialize(int addr, int level) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException
ChGpib
.
The resource "GPIB" has to be reserved.
addr
- the device-nr, the present GPIB-Board should have as GPIB-address
(0-32)level
- 0 means the GPIB-board is controller of the GPIB-bus
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
public void checkSrq(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException
getResourceName(int)
has to be reserved.
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
addGpibListener(ChGpibListener)
,
uncheckSrq(int)
public void uncheckSrq(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException
checkSrq(int)
an SRQ on the specified
device occurred.
The device resource getResourceName(int)
has to be reserved
before calling this method.
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
public void send(int dvcAddr, byte[] data, int length) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)data
- the bytes to be sent. The data has to be in non-binary form.length
- amount of bytes to be sent
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public void send(int dvcAddr, java.lang.String data) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)data
- the string to be sent. The data has to be in non-binary form.
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public byte[] enter(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.String(byte[])
public int spoll(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
ChGpibListener
.
The device resource getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
srq()
public int ppoll() throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
ChGpibListener
.
The resource "GPIB" has to be reserved before calling this method.
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
srq()
public void transmit(byte[] data, int length) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
data
- the bytes to be sent. The data cannot be in binary form.length
- amount of bytes to be sent
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public byte[] receive() throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
receive(int)
,
rarray()
,
rarray(int)
public byte[] receive(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the sending device on the gpib-bus (0-32)
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
receive()
,
rarray()
,
rarray(int)
public void tarray(byte[] data, int length, byte eoi) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
data
- the bytes to be sentlength
- amount of bytes to be senteoi
- EOI-Byte
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public void tarray(int dvcAddr, byte[] data, int length, byte eoi) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)data
- the bytes to be sentlength
- amount of bytes to be senteoi
- EOI-Byte
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public byte[] rarray() throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
rarray(int)
public byte[] rarray(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the sending device on the gpib-bus (0-32)
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
rarray(int)
public int srq() throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException
ChGpibListener
.
The resource "GPIB" has to be reserved before calling this method.
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
spoll(int)
,
ppoll()
public void setTimeOut(int msec) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
public int isListenerPresent(int dvcAddr) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException
getResourceName(int)
has to be reserved
before calling this method.
dvcAddr
- the device-nr of the checked device on the gpib-bus (0-32)
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
public int isGpibBoardPresent() throws java.rmi.RemoteException
java.rmi.RemoteException
public static java.lang.String getResourceName(int dvcAddr)
Example:
ChTask task=new ChTask("ATask"); task.addRsrc(conn,gpibClient.getRsrcName(7));
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |