|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.agilent.android.io.IO
public class IO
Allows you to control a LAN instrument using a Socket connection.
Nested Class Summary | |
---|---|
static class |
IO.BinaryBlockDataType
Specifies the type of data that makes up the IEEE Block Data. |
Field Summary | |
---|---|
int |
connectTimeout
The number of milliseconds to wait for a connection to connect. |
boolean |
isConnected
Specifies whether a connection has been made to the instrument. |
java.lang.String |
newLineToken
This string sequence (typically \n) specifies the value that will terminate a Scan call be appended to the end of the data on a Print call Defaults to "\n". |
int |
printTimeout
The number of milliseconds to wait for an instrument to accept data. |
int |
scanTimeout
The number of milliseconds to wait for an instrument to return data. |
Constructor Summary | |
---|---|
IO()
|
Method Summary | |
---|---|
void |
close()
Close the connection to the instrument. |
void |
deviceClear()
Sends a device clear command to the instrument. |
void |
openWithAddress(java.lang.String address,
int port)
Open a connection to the instrument. |
void |
print(java.lang.String message)
Sends a string of data to the instrument, automatically appending the newLineToken. |
void |
print(java.lang.String message,
boolean appendNewLine)
Sends a string of data to the instrument |
void |
printBuffer(byte[] buffer,
int size)
Sends a byte array of data to the instrument. |
void |
query(java.lang.String query,
java.lang.StringBuffer response)
Send a string of data to the instrument, then reads a string of data from the instrument |
void |
queryDeviceClearPort(java.lang.String query)
Queries the instrument for the port that should be used when doing a deviceClear. |
double[] |
readList()
Reads a list of data values from the instrument. |
void |
scan(java.lang.StringBuffer response)
Reads a string of data from the instrument, automatically removing the newLineToken from the end of the data |
void |
scan(java.lang.StringBuffer response,
boolean trimNewLine)
Reads a string of data from the instrument |
double[] |
scanBinaryDefiniteSizeBlocks(IO.BinaryBlockDataType dataType)
Reads an IEEE Binary Block of data from the instrument |
void |
scanBuffer(byte[] buffer,
int sizeToRead)
Reads a byte array of data from the instrument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int connectTimeout
public int scanTimeout
public int printTimeout
public boolean isConnected
public java.lang.String newLineToken
Constructor Detail |
---|
public IO()
Method Detail |
---|
public void openWithAddress(java.lang.String address, int port) throws AAIoException
address
- the IP address (e.g. 156.140.113.207) or hostname of the instrumentport
- number the instrument is connection on, usually 5025
AAIoException
- the ErrorType property of the thrown exception can have the following 2 values
public void close()
public void queryDeviceClearPort(java.lang.String query) throws AAIoException
query
- the command that is issued to the instrument to query for its control port. Defaults to:system:communicate:tcpip:control?>
- Throws:
AAIoException
- the ErrorType property of the thrown exception can have the following values:
- ErrorType.READ_ERROR if there was some exception thrown by the underlying socket library while reading from the instrument, check the inner exception
- ErrorType.WRITE_ERROR if there was some exception thrown by the underlying socket library while writing to the instrument, check the inner exception
- ErrorType.TIMEOUT_ERROR if the timeout lapsed before the data could be sent/received
public void printBuffer(byte[] buffer, int size) throws AAIoException
buffer
- the data to be sent. Last byte should be the newLineToken (typically \n)size
- number of bytes in the buffer to send
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void print(java.lang.String message) throws AAIoException
message
- the data to be sent
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void print(java.lang.String message, boolean appendNewLine) throws AAIoException
message
- the data to be sentappendNewLine
- true to append the newLineToken, false to not append the newLineToken
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void scanBuffer(byte[] buffer, int sizeToRead) throws AAIoException
buffer
- array where the data should be storedsizeToRead
- number of bytes to be read from the instrument
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void scan(java.lang.StringBuffer response) throws AAIoException
response
- where the data should be stored
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void scan(java.lang.StringBuffer response, boolean trimNewLine) throws AAIoException
response
- where the data should be storedtrimNewLine
- true to remove the newLineToken from the end of the buffer, false to not remove the newLineToken from the end of the buffer
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public double[] readList() throws AAIoException
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public double[] scanBinaryDefiniteSizeBlocks(IO.BinaryBlockDataType dataType) throws AAIoException
dataType
- the type of data that should be read
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void query(java.lang.String query, java.lang.StringBuffer response) throws AAIoException
query
- the data to be sent to the instrumentresponse
- where the data should be stored
AAIoException
- the ErrorType property of the thrown exception can have the following values:
public void deviceClear() throws AAIoException
AAIoException
- the ErrorType property of the thrown exception can have the following values:
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |