public class ADwinDevice
extends java.lang.Object
Add_Entry
method. The only Exception thrown by methods of this
class is ADwinCommunicationError
. Its getCode ()
method returns an error code that provides additional info about the error
occurred. Before any of the methods that provide access for the ADwin system
is called, Set_DeviceNo
must have been called first.Modifier and Type | Class and Description |
---|---|
static class |
ADwinDevice.first_pcarray_index_t |
Modifier and Type | Field and Description |
---|---|
static int |
LANGID_ENGLISH |
static int |
LANGID_GERMAN |
static int |
LANGID_SYSDEFAULT |
Constructor and Description |
---|
ADwinDevice()
Construct a new ADwinDevice object, the language for Exceptions etc. is
set to English, except when
Locale.getDefault ().getISO3Language ().compareTo ("deu") ! |
Modifier and Type | Method and Description |
---|---|
void |
Add_Entry(int deviceNo,
java.net.InetAddress ipAddressADwinSystem,
java.lang.String password,
int tcpipServerDeviceNo,
int port)
Appends a new entry to the device table.
|
void |
Add_Entry(int deviceNo,
java.net.InetAddress ipAddressADwinSystem,
java.lang.String password,
int tcpipServerDeviceNo,
int port,
int networkTimeout)
Appends a new entry to the device table.
|
void |
Boot(java.lang.String Filename)
Boots an ADwin system and loads an operating system.
|
void |
Clear_Process(int ProcessNo)
Deletes a process and frees all resources that were allocated by it.
|
int |
Data_Length(int DataNo)
Reads the length of a data field.
|
int |
Data_Type(int DataNo)
Delivers the type of a data
|
void |
Data2File(java.lang.String Filename,
int DataNo,
int Startindex,
int Count,
int Mode)
Reads a data field and stores or appends it to a file.
|
void |
Fifo_Clear(int FifoNo)
Removes all values from a fifo that have been written to it.
|
int |
Fifo_Empty(int FifoNo)
Reads the number of free elements in a fifo.
|
int |
Fifo_Full(int FifoNo)
Reads the number of elements that have been written to a fifo, and have
not been read yet.
|
void |
File2Data(java.lang.String Filename,
int DataType,
int DataNo,
int Startindex)
File2Data copies values from a file (on the hard disk) into a DATA array
of the ADwin system.
|
int |
Free_Mem(int Mem_Spec)
Returns the amount of free RAM of an ADwin system in bytes.
|
ADwinDevice |
Get_Copy()
Creates an independent copy of this object.
|
int |
Get_DeviceNo()
Reads the currently active device number.
|
void |
Get_FPar_All_Double(double[] Array)
Reads all double parameters into an array.
|
void |
Get_FPar_All_Double(double[] Array,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads all double parameters into an array.
|
void |
Get_FPar_All(float[] Array)
Reads all float parameters into an array.
|
void |
Get_FPar_All(float[] Array,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads all float parameters into an array.
|
void |
Get_FPar_Block_Double(double[] Array,
int FirstIndex,
int Count)
Reads a block of double parameters.
|
void |
Get_FPar_Block_Double(double[] Array,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads a block of double parameters.
|
void |
Get_FPar_Block(float[] Array,
int FirstIndex,
int Count)
Reads a block of float parameters.
|
void |
Get_FPar_Block(float[] Array,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads a block of float parameters.
|
double |
Get_FPar_Double(int Index)
Reads a double parameter from the ADwin system.
|
float |
Get_FPar(int Index)
Reads a float parameter from the ADwin system.
|
int |
Get_Globaldelay(int ProcessNo)
Deprecated.
As of 1.2, replaced by
Get_Processdelay(int) |
int[] |
Get_Known_DeviceNo()
Returns an array that contains all device numbers that have been added
(with
Add_Entry ) to this class. |
void |
Get_Par_All(int[] Array)
Reads all integer parameters into an array.
|
void |
Get_Par_All(int[] Array,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads all integer parameters into an array.
|
void |
Get_Par_Block(int[] Array,
int FirstIndex,
int Count)
Reads a block of integer parameters.
|
void |
Get_Par_Block(int[] Array,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads a block of integer parameters.
|
int |
Get_Par(int Index)
Reads an integer parameter from the ADwin system.
|
int |
Get_Processdelay(int ProcessNo)
Gets the process delay of a process.
|
void |
GetData_Double(int DataNo,
double[] Data,
int FirstIndex,
int Count)
Reads a part of a double data field.
|
void |
GetData_Double(int DataNo,
double[] Data,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads a part of a double data field.
|
void |
GetData_Float(int DataNo,
float[] Data,
int FirstIndex,
int Count)
Reads a part of a float data field.
|
void |
GetData_Float(int DataNo,
float[] Data,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads a part of a float data field.
|
void |
GetData_Long(int DataNo,
int[] Data,
int FirstIndex,
int Count)
Reads a part of an integer data field.
|
void |
GetData_Long(int DataNo,
int[] Data,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Reads a part of an integer data field.
|
java.lang.String |
GetData_String(int DataNo)
Reads a string data field.
|
int |
GetData_String(int DataNo,
char[] Data,
int MaxCount)
reads a string data field in a
char Array. |
void |
GetFifo_Double(int FifoNo,
double[] Data,
int Count)
Reads some doubles from a fifo.
|
void |
GetFifo_Float(int FifoNo,
float[] Data,
int Count)
Reads some floats from a fifo.
|
void |
GetFifo_Long(int FifoNo,
int[] Data,
int Count)
Reads some integers from a fifo.
|
void |
Load_Process(java.lang.String Filename)
Loads a process (a file of the form < ffff >.T< p > < n >, with ffff =
some file name, p = Processor, n = process number) onto an ADwin system.
|
int |
Process_Status(int ProcessNo)
Gets the information if a process is running.
|
int |
Processor_Type()
Returns the processor that is installed on the current ADwin system.
|
boolean |
Remove_Entry(int DevNo)
Deletes an entry that has been added with
Add_Entry from the
device table. |
void |
Set_DeviceNo(int DevNo)
Chooses a device from the device table to work with.
|
void |
Set_FPar_Double(int Index,
double Value)
Sets a double parameter.
|
void |
Set_FPar(int Index,
float Value)
Sets a float parameter.
|
void |
Set_Globaldelay(int ProcessNo,
int Globaldelay)
Deprecated.
As of 1.2, replaced by
Set_Processdelay(int, int) |
void |
Set_Language(int LanguageID)
Sets the language for messages of exceptions.
|
void |
Set_Par(int Index,
int Value)
Sets one of the integer parameters.
|
void |
Set_Processdelay(int ProcessNo,
int Processdelay)
Sets the process delay of a process.
|
void |
SetData_Double(int DataNo,
double[] Data,
int FirstIndex,
int Count)
Sets a part of a double data field.
|
void |
SetData_Double(int DataNo,
double[] Data,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Sets a part of a double data field.
|
void |
SetData_Float(int DataNo,
float[] Data,
int FirstIndex,
int Count)
Sets a part of a float data field.
|
void |
SetData_Float(int DataNo,
float[] Data,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Sets a part of a float data field.
|
void |
SetData_Long(int DataNo,
int[] Data,
int FirstIndex,
int Count)
Sets a part of an integer data field.
|
void |
SetData_Long(int DataNo,
int[] Data,
int FirstIndex,
int Count,
ADwinDevice.first_pcarray_index_t FirstArrayIndex)
Sets a part of an integer data field.
|
void |
SetData_String(int DataNo,
java.lang.String Data)
Writes a string into a string data field.
|
void |
SetFifo_Double(int FifoNo,
double[] Data,
int Count)
Writes some doubles into a fifo.
|
void |
SetFifo_Float(int FifoNo,
float[] Data,
int Count)
Writes some floats into a fifo.
|
void |
SetFifo_Long(int FifoNo,
int[] Data,
int Count)
Writes some integers into a fifo.
|
void |
Start_Process(int ProcessNo)
Starts a process that has been loaded previously with
Load_Process . |
void |
Stop_Process(int ProcessNo)
Stops a process.
|
int |
String_Length(int DataNo)
Determines the length of a string.
|
int |
Test_Version()
Tests if an ADwin system is accessible.
|
void |
Use_FileLocks(boolean Usage)
Controls if files are created on the hard disk (in the temporary
directory) to synchronize the access on an ADwin-System (With AEI
Versions < 2.52 and AEI Versions between 2.6 and 2.64, this is
necessary).
|
int |
Workload()
Returns the CPU load of an ADwin system.
|
public static final int LANGID_ENGLISH
public static final int LANGID_GERMAN
public static final int LANGID_SYSDEFAULT
public ADwinDevice()
Locale.getDefault ().getISO3Language ().compareTo ("deu") != 0
is true
.public void Add_Entry(int deviceNo, java.net.InetAddress ipAddressADwinSystem, java.lang.String password, int tcpipServerDeviceNo, int port)
Set_DeviceNo
.ipAddressADwinSystem
should be the IP
address of the computer the TCP/IP-Server runs on, e.g.
"127.0.0.1"
if the server runs on the same
computer as the Java program.tcpipServerDeviceNo
identifies a Device Number that has been
configured with ADconfig on the computer the TCP/IP-Sever runs on.deviceNo
- New device number to storeipAddressADwinSystem
- IP address of the devicepassword
- Password (that has been set with ADConfig)tcpipServerDeviceNo
- This value is used by the program ADwin
TCP/IP-Server. If the device that is added to the device table is not
connected via the ADwin TCP/IP-Server, the parameter is ignored.port
- Port that the ADwin System has been configured (with
ADconfig) to use (default: 6543)java.lang.IllegalArgumentException
- If the device number already existsSet_DeviceNo(int)
public void Add_Entry(int deviceNo, java.net.InetAddress ipAddressADwinSystem, java.lang.String password, int tcpipServerDeviceNo, int port, int networkTimeout)
Set_DeviceNo
.ipAddressADwinSystem
should be the IP
address of the computer the TCP/IP-Server runs on, e.g.
"127.0.0.1"
if the server runs on the same
computer as the Java program.tcpipServerDeviceNo
identifies a Device Number that has been
configured with ADconfig on the computer the TCP/IP-Sever runs on.deviceNo
- New device number to storeipAddressADwinSystem
- IP address of the devicepassword
- Password (that has been set with ADConfig)tcpipServerDeviceNo
- This value is used by the program ADwin
TCP/IP-Server. If the device that is added to the device table is not
connected via by the ADwin TCP/IP-Server, the parameter is ignored.port
- Port that the ADwin System has been configured (with
ADconfig) to use (default: 6543)networkTimeout
- Maximum time to wait for a response of the ADwin
System, in milliseconds.java.lang.IllegalArgumentException
- If the device number already existsSet_DeviceNo(int)
public boolean Remove_Entry(int DevNo)
Add_Entry
from the
device table.DevNo
- Device number that is to be deletedtrue
, if the device number has been found and
something was done.Add_Entry(int, java.net.InetAddress, java.lang.String, int, int)
public void Use_FileLocks(boolean Usage) throws ADwinCommunicationError
true
is passed for Usage
, multiple Java
processes running on the same machine can acces the same ADwin-System at
the same time, even if an older version is used. However, the
synchronization takes about a tenth of a millisecond per call of a
method.Usage
- pass true
to enable synchronization with disk
files, or false
to disable it.ADwinCommunicationError
- If the lock file could not be createdpublic void Set_Language(int LanguageID)
LanguageID
- LANGID_SYSDEFAULT (0)
,
LANGID_ENGLISH (1)
or LANGID_GERMAN (2)
public int[] Get_Known_DeviceNo()
Add_Entry
) to this class.public void Set_DeviceNo(int DevNo) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain:
4000, 2000DevNo
- Device number that is made the current device.java.lang.IllegalArgumentException
- if the device number is not in the
device table.ADwinCommunicationError
Add_Entry(int, java.net.InetAddress, java.lang.String, int, int)
,
Table of error codes
public int Get_DeviceNo()
public int Get_Par(int Index) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain:
4000, 2002, 2000, 1, 2Index
- Index of the integer parameter to read.java.lang.IllegalArgumentException
- if Index
is too high.ADwinCommunicationError
Get_FPar(int)
,
Set_Par(int, int)
,
Table of error codes
public int Processor_Type() throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000,
2002, 2000, 1, 2ADwinCommunicationError
Table of error codes
public void GetData_Long(int DataNo, int[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data field to read.Data
- Array where the data read is stored.FirstIndex
- first index to read from the data field on the ADwin
system.Count
- Number of integers to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo is out of range (1 <=
DataNo <= 200)java.lang.IndexOutOfBoundsException
- If Data is too smallSetData_Long(int, int[], int, int)
,
Table of error codes
public void GetData_Long(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data field to read.Data
- Array where the data read is stored.FirstIndex
- first index to read from the data field on the ADwin
system.Count
- Number of integers to read.FirstArrayIndex
- specify if the returned array should be zero-based
or one-based.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo is out of range (1 <=
DataNo <= 200)java.lang.IndexOutOfBoundsException
- If Data is too smallSetData_Long(int, int[], int, int)
,
Table of error codes
public void GetData_Float(int DataNo, float[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data field to read.Data
- Array where the data read is stored.FirstIndex
- first index to read from the data field on the ADwin
system.Count
- Number of floats to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo is out of range (1 <=
DataNo <= 200)java.lang.IndexOutOfBoundsException
- If Data is too smallSetData_Float(int, float[], int, int)
,
Table of error codes
public void GetData_Float(int DataNo, float[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data field to read.Data
- Array where the data read is stored.FirstIndex
- first index to read from the data field on the ADwin
system.Count
- Number of floats to read.FirstArrayIndex
- specify if the returned array should be zero-based
or one-based.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo is out of range (1 <=
DataNo <= 200)java.lang.IndexOutOfBoundsException
- If Data is too smallSetData_Float(int, float[], int, int)
,
Table of error codes
public void GetData_Double(int DataNo, double[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data field to read.Data
- Array where the data read is stored.FirstIndex
- first index to read from the data field on the ADwin
system.Count
- Number of floats to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo is out of range (1 <=
DataNo <= 200)java.lang.IndexOutOfBoundsException
- If Data is too smallSetData_Double(int, double[], int, int)
,
Table of error codes
public void GetData_Double(int DataNo, double[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data field to read.Data
- Array where the data read is stored.FirstIndex
- first index to read from the data field on the ADwin
system.Count
- Number of floats to read.FirstArrayIndex
- specify if the returned array should be zero-based
or one-based.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo is out of range (1 <=
DataNo <= 200)java.lang.IndexOutOfBoundsException
- If Data is too smallSetData_Double(int, double[], int, int)
,
Table of error codes
public void SetData_Long(int DataNo, int[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data to setData
- Array that contains the new values for the data field.FirstIndex
- First index of the data field to setCount
- Number of elements to setADwinCommunicationError
java.lang.IllegalArgumentException
- If the data field is not of type int, or
if FirstIndex
and Count
do not match the size
of the field.GetData_Long(int, int[], int, int)
,
Table of error codes
public void SetData_Long(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data to setData
- Array that contains the new values for the data field.FirstIndex
- First index of the data field to setCount
- Number of elements to setFirstArrayIndex
- specify if the given array is zero-basedADwinCommunicationError
java.lang.IllegalArgumentException
- If the data field is not of type int, or
if FirstIndex
and Count
do not match the size
of the field.GetData_Long(int, int[], int, int)
,
Table of error codes
public void SetData_Float(int DataNo, float[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data to setData
- Array that contains the new values for the data field.FirstIndex
- First index of the data field to setCount
- Number of elements to setADwinCommunicationError
java.lang.IllegalArgumentException
- If the data field is not of type int, or
if FirstIndex
and Count
do not match the size
of the field.GetData_Float(int, float[], int, int)
,
Table of error codes
public void SetData_Float(int DataNo, float[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data to setData
- Array that contains the new values for the data field.FirstIndex
- First index of the data field to setCount
- Number of elements to setFirstArrayIndex
- specify if the given array is zero-basedADwinCommunicationError
java.lang.IllegalArgumentException
- If the data field is not of type int, or
if FirstIndex
and Count
do not match the size
of the field.GetData_Float(int, float[], int, int)
,
Table of error codes
public void SetData_Double(int DataNo, double[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data to setData
- Array that contains the new values for the data field.FirstIndex
- First index of the data field to setCount
- Number of elements to setADwinCommunicationError
java.lang.IllegalArgumentException
- If the data field is not of type double,
or if FirstIndex
and Count
do not match the
size of the field.GetData_Double(int, double[], int, int)
,
Table of error codes
public void SetData_Double(int DataNo, double[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly
will contain: 4000, 2002, 2000, 100, 2, 1DataNo
- Number of the data to setData
- Array that contains the new values for the data field.FirstIndex
- First index of the data field to setCount
- Number of elements to setFirstArrayIndex
- specify if the given array is zero-basedADwinCommunicationError
java.lang.IllegalArgumentException
- If the data field is not of type double,
or if FirstIndex
and Count
do not match the
size of the field.GetData_Double(int, double[], int, int)
,
Table of error codes
public void Set_Par(int Index, int Value) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Index
- Number of the parameter to setValue
- new value for the parameterjava.lang.IllegalArgumentException
- If Index
is too highADwinCommunicationError
Table of error codes
,
Table of error codes
public void Get_Par_Block(int[] Array, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are storedFirstIndex
- Index of the first parameter to readCount
- number of parameters to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FirstIndex
or
Count
are negative, or are too bigTable of error codes
public void Get_Par_Block(int[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are storedFirstIndex
- Index of the first parameter to readCount
- number of parameters to read.FirstArrayIndex
- specify if the returned array should be zero-based
or one-based.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FirstIndex
or
Count
are negative, or are too bigTable of error codes
public void Get_FPar_Block(float[] Array, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are storedFirstIndex
- Index of the first parameter to readCount
- number of parameters to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FirstIndex
or
Count
are negative, or are too bigTable of error codes
public void Get_FPar_Block(float[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are storedFirstIndex
- Index of the first parameter to readCount
- number of parameters to read.FirstArrayIndex
- specify if the returned array should be zero-basedADwinCommunicationError
java.lang.IllegalArgumentException
- If FirstIndex
or
Count
are negative, or are too bigTable of error codes
public void Get_FPar_Block_Double(double[] Array, int FirstIndex, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are storedFirstIndex
- Index of the first parameter to readCount
- number of parameters to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FirstIndex
or
Count
are negative, or are too bigTable of error codes
public void Get_FPar_Block_Double(double[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are storedFirstIndex
- Index of the first parameter to readCount
- number of parameters to read.FirstArrayIndex
- specify if the returned array should be zero-basedADwinCommunicationError
java.lang.IllegalArgumentException
- If FirstIndex
or
Count
are negative, or are too bigTable of error codes
public int Data_Length(int DataNo) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
100, 2000, 2, 1.DataNo
- Number of the data from which the length should be read.ADwinCommunicationError
Table of error codes
public int Fifo_Empty(int FifoNo) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 2, 1.FifoNo
- Number of the fifo whose number of free elements is to be
determined.java.lang.IllegalArgumentException
- If FifoNo
is not in the
range [1, 200]ADwinCommunicationError
Table of error codes
public int Fifo_Full(int FifoNo) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000,
2002, 2000, 2, 1.FifoNo
- Number of the fifo whose number of used elements is to be
determined.java.lang.IllegalArgumentException
- If FifoNo
is not in the
range [1, 200]ADwinCommunicationError
Table of error codes
public void Fifo_Clear(int FifoNo) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.FifoNo
- Fifo that will be clearedjava.lang.IllegalArgumentException
- If FifoNo
is not in the
range [1, 200].ADwinCommunicationError
Table of error codes
public void SetFifo_Long(int FifoNo, int[] Data, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
Fifo_Empty
to
check if there is enough space left in it. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
101, 2000, 2, 1.FifoNo
- Number of the fifo to write to.Data
- Array that contains the data to writeCount
- Number of elements to write.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FifoNo
is not the number
of an integer fifoTable of error codes
,
Fifo_Empty(int)
public void SetFifo_Float(int FifoNo, float[] Data, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
Fifo_Empty
to
check if there is enough space left in it. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
101, 2000, 2, 1.FifoNo
- Number of the fifo to write to.Data
- Array that contains the data to writeCount
- Number of elements to write.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FifoNo
is not the number
of a float fifoTable of error codes
,
Fifo_Empty(int)
public void SetFifo_Double(int FifoNo, double[] Data, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException
Fifo_Empty
to
check if there is enough space left in it. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
101, 2000, 2, 1.FifoNo
- Number of the fifo to write to.Data
- Array that contains the data to writeCount
- Number of elements to write.ADwinCommunicationError
java.lang.IllegalArgumentException
- If FifoNo
is not the number
of a float fifoTable of error codes
,
Fifo_Empty(int)
public void Get_Par_All(int[] Array) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are stored. Its size must be >=
80.ADwinCommunicationError
Table of error codes
public void Get_Par_All(int[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.
or one-based.Array
- Array, where the parameters are stored. Its size must be >=FirstArrayIndex
- specify if the returned array should be zero-based
* 80.ADwinCommunicationError
Table of error codes
public void Get_FPar_All(float[] Array) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are stored. Its size must be >=
80.ADwinCommunicationError
Table of error codes
public void Get_FPar_All(float[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are stored. Its size must be >=FirstArrayIndex
- specify if the returned array should be zero-based
80.ADwinCommunicationError
Table of error codes
public void Get_FPar_All_Double(double[] Array) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are stored. Its size must be >=
80.ADwinCommunicationError
Table of error codes
public void Get_FPar_All_Double(double[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Array
- Array, where the parameters are stored. Its size must be >=FirstArrayIndex
- specify if the returned array should be zero-based
80.ADwinCommunicationError
Table of error codes
public void GetFifo_Long(int FifoNo, int[] Data, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
Fifo_Full
to
check if there have enough elements been written to it. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 102, 2, 1.FifoNo
- Number of the fifo to read out.Data
- Array where the data from the fifo is storedCount
- Number of elements to readADwinCommunicationError
java.lang.IndexOutOfBoundsException
- If Data is too smalljava.lang.IllegalArgumentException
Table of error codes
,
Fifo_Full(int)
public void GetFifo_Float(int FifoNo, float[] Data, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
Fifo_Full
to
check if there have enough elements been written to it. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 102, 2, 1.FifoNo
- Number of the fifo to read out.Data
- Array where the data from the fifo is storedCount
- Number of elements to readADwinCommunicationError
java.lang.IndexOutOfBoundsException
- If Data is too smalljava.lang.IllegalArgumentException
Table of error codes
,
Fifo_Full(int)
public void GetFifo_Double(int FifoNo, double[] Data, int Count) throws ADwinCommunicationError, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
Fifo_Full
to
check if there have enough elements been written to it. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 102, 2, 1.FifoNo
- Number of the fifo to read out.Data
- Array where the data from the fifo is storedCount
- Number of elements to readADwinCommunicationError
java.lang.IndexOutOfBoundsException
- If Data is too smalljava.lang.IllegalArgumentException
Table of error codes
,
Fifo_Full(int)
public float Get_FPar(int Index) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Index
- Number of the float parameter to readADwinCommunicationError
java.lang.IllegalArgumentException
- if Index
is not in the
range [1, 80]Table of error codes
,
Set_FPar(int, float)
public double Get_FPar_Double(int Index) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Index
- Number of the float parameter to readADwinCommunicationError
java.lang.IllegalArgumentException
- if Index
is not in the
range [1, 80]Table of error codes
,
Set_FPar(int, float)
public void Set_FPar(int Index, float Value) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 2, 1.Index
- Number of the float parameter to setValue
- New Value for the parameterADwinCommunicationError
java.lang.IllegalArgumentException
- if Index
is not in the
range [1, 80]Table of error codes
,
Get_FPar(int)
public void Set_FPar_Double(int Index, double Value) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.Index
- Number of the double parameter to setValue
- New Value for the parameterADwinCommunicationError
java.lang.IllegalArgumentException
- if Index
is not in the
range [1, 80]Table of error codes
,
Get_FPar_Double(int)
public int Workload() throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.ADwinCommunicationError
Table of error codes
public int Free_Mem(int Mem_Spec) throws ADwinCommunicationError
Returns the amount of free RAM of an ADwin system in bytes.
Mem_Spec
determines which kind of RAM:
0 | All types of memory (only CPUs T2, T4, T5, T8) |
1 | Local program memory (T9 and up) |
2 | Local data memory (EM_LOCAL) (T11 and up) |
3 | Local data memory (T9 and up) |
4 | external DRAM memory (T9 and up) |
Code that an ADwinCommunicationError
possibly will contain:
4000, 2002, 2000, 2, 1.
Mem_Spec
- Kind of memoryADwinCommunicationError
Table of error codes
public void Load_Process(java.lang.String Filename) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain:
4000, 2002, 2000, 205, 202, 200, 2, 1.Filename
- Name of the file to loadADwinCommunicationError
Table of error codes
public void Start_Process(int ProcessNo) throws ADwinCommunicationError
Load_Process
. Process_Status
can be used to
determine if a process has been started. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.ProcessNo
- Number of the process that will be started.ADwinCommunicationError
Table of error codes
,
Process_Status(int)
public void Stop_Process(int ProcessNo) throws ADwinCommunicationError
Start_Process
, and can be resumed with
Start_Process
. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.ProcessNo
- Number of the process to stopADwinCommunicationError
Table of error codes
public void Clear_Process(int ProcessNo) throws ADwinCommunicationError
Stop_Process
before it
can be deleted. Process_Status
can be used to determine if
the process is still running. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.ProcessNo
- Number of the process that will be deletedADwinCommunicationError
java.lang.IllegalArgumentException
- If ProcessNo
is not in the
range [1, 15]Table of error codes
,
Stop_Process(int)
public int Process_Status(int ProcessNo) throws ADwinCommunicationError
1 | Process is running |
0 | Process is not running. It is either not loaded, has been stopped or has not been started |
-1 | Process is about to be stopped, but its last event has not occurred yet. |
ADwinCommunicationError
possibly will contain:
4000, 2002, 2000, 2, 1.ProcessNo
- Number of the process that will be checkedADwinCommunicationError
java.lang.IllegalArgumentException
- If ProcessNo
is not in the
range [1, 15].Table of error codes
public void Boot(java.lang.String Filename) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 204, 200, 2, 1.Filename
- Name of the file that contains the operating system that
will be loaded.ADwinCommunicationError
Table of error codes
public java.lang.String GetData_String(int DataNo) throws ADwinCommunicationError
SetData_String
can be used to
write a string. Code that an ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 100, 2, 1.DataNo
- Number of the data field to read.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo
is out of range,
or if data DataNo
is not of type int.Table of error codes
,
SetData_String(int, java.lang.String)
public int GetData_String(int DataNo, char[] Data, int MaxCount) throws ADwinCommunicationError
char
Array. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 100, 2, 1.DataNo
- Number of the data field to read.Data
- Is filled in by this method and contains the string read.MaxCount
- Maximum number of characters to read. If the string on
the ADwin System is shorter than MaxCount
, less characters
are read.java.lang.IllegalArgumentException
- If DataNo
is out of range,
or if data DataNo
is not of type int.ADwinCommunicationError
public void SetData_String(int DataNo, java.lang.String Data) throws ADwinCommunicationError, java.lang.IllegalArgumentException
GetData_String
>
can be used to read a string. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.DataNo
- Number of the data field that will be written to.Data
- String that will be writtenADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo
is out of range.Table of error codes
,
GetData_String(int)
public int String_Length(int DataNo) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.DataNo
- Number of the string data field.DataNo
.ADwinCommunicationError
java.lang.IllegalArgumentException
- If DataNo
is out of range.java.lang.IllegalArgumentException
- If DataNo
is out of rangeTable of error codes
public void Set_Globaldelay(int ProcessNo, int Globaldelay) throws ADwinCommunicationError
Set_Processdelay(int, int)
ProcessNo
- number of the process whose process delay is setGlobaldelay
- new process delayADwinCommunicationError
public void Set_Processdelay(int ProcessNo, int Processdelay) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 2, 1.ProcessNo
- number of the process whose process delay is setProcessdelay
- new process delayADwinCommunicationError
java.lang.IllegalArgumentException
- If ProcessNo
exceeds the
valid rangeTable of error codes
,
Get_Processdelay(int)
public int Get_Globaldelay(int ProcessNo) throws ADwinCommunicationError
Get_Processdelay(int)
ProcessNo
- The ProcessnumberADwinCommunicationError
public int Get_Processdelay(int ProcessNo) throws ADwinCommunicationError
Set_Processdelay
, or (if Set_Processdelay
has
not been used yet) the process delay returned is the setting stored in
the binary ADbasic file. Code that an
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 2, 1.ProcessNo
- The ProcessnumberADwinCommunicationError
java.lang.IllegalArgumentException
- If ProcessNo
exceeds the
valid rangeTable of error codes
,
Set_Processdelay(int, int)
public int Test_Version() throws ADwinCommunicationError
Boot
to determine if the correct BTL file was loaded. Code
that an ADwinCommunicationError
possibly will contain: 4000.ADwinCommunicationError
Table of error codes
,
Boot(java.lang.String)
public void Data2File(java.lang.String Filename, int DataNo, int Startindex, int Count, int Mode) throws ADwinCommunicationError
ADwinCommunicationError
possibly will contain: 4000, 2002,
2000, 205, 100, 2, 1.Filename
- Name of the file to write toDataNo
- Number of the data to readStartindex
- First index in the data field to readCount
- Number of words (floats or integers) to readMode
- Mode
= 0: File is overwritten, Mode
= 1: The data is appended to an existing filejava.lang.IllegalArgumentException
- If Mode
is not 0 or 1.ADwinCommunicationError
Table of error codes
public void File2Data(java.lang.String Filename, int DataType, int DataNo, int Startindex) throws ADwinCommunicationError, java.lang.IllegalArgumentException
ADwinCommunicationError
possibly will contain: 4000, 2002, 2000, 205, 100, 2, 1.Filename
- Pointer to path and source file name. If no path is
indicated, the file is searched for in the project directory.DataType
- Data type of values saved in the file. Select one of the
following contants: DATATYPE_INT (3): Values of type integer (32 bit).
DATATYPE_FLOAT (5): Values of type float (32 bit). DATATYPE_DOUBLE (6):
Values of type float (64 bit).DataNo
- Number (1...200) of the destination array DATA_1 ...
DATA_200.Startindex
- Index (≥1) of the element in the destination array to
be written first.java.lang.IllegalArgumentException
- If DataType
is not 3, 5 or
6.ADwinCommunicationError
Table of error codes
public int Data_Type(int DataNo) throws ADwinCommunicationError
DataNo
- Number of the dataADwinCommunicationError
Table of error codes
public ADwinDevice Get_Copy()
Set_DeviceNo
must be called, before the
copy is used for first time. The language settings and the device table
configured in the copy are identical to the original.