|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charly.client.ChGpibUnit
This class represents a device or a channel of a device on the
GPIB-bus. Before calling the methods of an instance of this class
a ChTask
with the appropriate resources (the GPIB bus,
or the single GPIB-device) has to
be started.
setTask(ChTask)
Field Summary | |
protected ChConnect |
conn
|
(package private) int |
dvcAddr
|
protected ChGpibDevice |
gpibDvc
|
(package private) java.lang.String |
suffix
|
protected ChTask |
task
|
Constructor Summary | |
ChGpibUnit(ChConnect conn,
int dvcAddr)
Konstruktor |
|
ChGpibUnit(ChConnect conn,
int dvcAddr,
java.lang.String suffix)
Konstruktor |
Method Summary | |
byte[] |
enter()
receives from the device on the gpib-bus. |
ChConnect |
getConnection()
Implementations should return the connection to the server where the resource can be found. |
java.lang.String |
getResourceName()
returns the resource name, e.g. |
ChTask |
getTask()
|
int |
isListenerPresent()
tests if listener with specified address is present. |
byte[] |
rarray()
receives binary and non-binary data from the device of the gpib-bus. |
byte[] |
receive()
receives non-binary data from the gpib-bus. |
void |
send(byte[] data,
int length)
sends a specified string to the device on the gpib-bus. |
void |
send(java.lang.String data)
sends a specified string to the device on the gpib-bus. |
byte[] |
sendAndEnter(byte[] data,
int length)
sends a string to the device on the gpib-bus and enters a string from this device. |
byte[] |
sendAndEnter(java.lang.String data)
sends a string to the device on the gpib-bus and enters a string from this device. |
void |
setTask(ChTask task)
This method must be called to be able to use the other methods. |
void |
tarray(int dvcAddr,
byte[] data,
int length,
byte eoi)
sends data to a given device of the gpib-bus. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
int dvcAddr
java.lang.String suffix
protected ChGpibDevice gpibDvc
protected ChConnect conn
protected ChTask task
Constructor Detail |
public ChGpibUnit(ChConnect conn, int dvcAddr, java.lang.String suffix) throws ChNestedException
conn
- - the server to connect to; on this server charlyServer
must have been starteddvcAddr
- - the number of the device on the GPIB bus (0-31)suffix
- - the name of the channel, e.g. CHANNEL0; can be
null
.
ChNestedException
- - Nested exception can be
RemoteException,
MalformedURLException,
NotBoundExceptionpublic ChGpibUnit(ChConnect conn, int dvcAddr) throws ChNestedException
conn
- - the server to connect to; on this server charlyServer
must have been starteddvcAddr
- - the number of the device on the GPIB bus (0-31)Method Detail |
public java.lang.String getResourceName()
getResourceName
in interface ChResource
public ChConnect getConnection()
ChResource
getConnection
in interface ChResource
public void setTask(ChTask task)
setTask
in interface ChResource
public ChTask getTask()
public void send(byte[] data, int length) throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
data
- the bytes to be sent. The data has to be in non-binary form.length
- amount of bytes to be sent
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public void send(java.lang.String data) throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
data
- the string to be sent. The data has to be in
non-binary form.
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public byte[] sendAndEnter(byte[] data, int length) throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
data
- the bytes to be sent. The data has to be in non-binary form.length
- amount of bytes to be sent
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public byte[] sendAndEnter(java.lang.String data) throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
data
- the string to be sent.
The data has to be in non-binary form.
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public byte[] enter() throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.String(byte[])
public byte[] receive() throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
rarray()
public void tarray(int dvcAddr, byte[] data, int length, byte eoi) throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
data
- the bytes to be sentlength
- amount of bytes to be senteoi
- EOI-Byte
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
String.getBytes()
public byte[] rarray() throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
getResourceName()
has to be reserved
before calling this method.
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
receive()
public int isListenerPresent() throws ChNestedException, ChTaskNotStartedException, ChAccessDeniedException
getResourceName()
has to be reserved
before calling this method.
ChNestedException
- - nested exception can be
RemoteException
ChTaskNotStartedException
ChAccessDeniedException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |