Package de.adwin.driver
Class ADwinDevice
- java.lang.Object
-
- de.adwin.driver.ADwinDevice
-
public class ADwinDevice extends Object
Provides access to ADwin Devices, and a simple device table. The device table in this class is not related to the ADconfig device table.
Each device that is to be used must be added to the device table with theAdd_Entrymethod. The only Exception thrown by methods of this class isADwinCommunicationError. ItsgetCode ()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_DeviceNomust have been called first.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classADwinDevice.first_pcarray_index_t
-
Field Summary
Fields Modifier and Type Field Description static intLANGID_ENGLISHstatic intLANGID_GERMANstatic intLANGID_SYSDEFAULT
-
Constructor Summary
Constructors Constructor Description ADwinDevice()Construct a new ADwinDevice object, the language for Exceptions etc. is set to English, except whenLocale.getDefault ().getISO3Language ().compareTo ("deu") !
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidAdd_Entry(int deviceNo, InetAddress ipAddressADwinSystem, String password, int tcpipServerDeviceNo, int port)Appends a new entry to the device table.voidAdd_Entry(int deviceNo, InetAddress ipAddressADwinSystem, String password, int tcpipServerDeviceNo, int port, int networkTimeout)Appends a new entry to the device table.voidAdd_Entry(int DevNo, InetAddress IP, String Password, int Timeout, int ADTimeout, int AllowedErrors, int NumWaits, int WaitTime, int Blocksize, int Hostlink, int Port)voidBoot(byte[] File, String Filename)voidBoot(String Filename)Boots an ADwin system and loads an operating system.voidBoot(URL btl)voidClear_Process(int ProcessNo)Deletes a process and frees all resources that were allocated by it.intData_Length(int DataNo)Reads the length of a data field.intData_Type(int DataNo)Delivers the type of a datavoidData2File(String Filename, int DataNo, int Startindex, int Count, int Mode)Reads a data field and stores or appends it to a file.voidFifo_Clear(int FifoNo)Removes all values from a fifo that have been written to it.intFifo_Empty(int FifoNo)Reads the number of free elements in a fifo.intFifo_Full(int FifoNo)Reads the number of elements that have been written to a fifo, and have not been read yet.voidFile2Data(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.intFree_Mem(int Mem_Spec)Returns the amount of free RAM of an ADwin system in bytes.ADwinDeviceGet_Copy()Creates an independent copy of this object.intGet_DeviceNo()Reads the currently active device number.floatGet_FPar(int Index)Reads a float parameter from the ADwin system.voidGet_FPar_All(float[] Array)Reads all float parameters into an array.voidGet_FPar_All(float[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads all float parameters into an array.voidGet_FPar_All_Double(double[] Array)Reads all double parameters into an array.voidGet_FPar_All_Double(double[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads all double parameters into an array.voidGet_FPar_Block(float[] Array, int FirstIndex, int Count)Reads a block of float parameters.voidGet_FPar_Block(float[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads a block of float parameters.voidGet_FPar_Block_Double(double[] Array, int FirstIndex, int Count)Reads a block of double parameters.voidGet_FPar_Block_Double(double[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads a block of double parameters.doubleGet_FPar_Double(int Index)Reads a double parameter from the ADwin system.intGet_Globaldelay(int ProcessNo)Deprecated.As of 1.2, replaced byGet_Processdelay(int)int[]Get_Known_DeviceNo()Returns an array that contains all device numbers that have been added (withAdd_Entry) to this class.intGet_Par(int Index)Reads an integer parameter from the ADwin system.voidGet_Par_All(int[] Array)Reads all integer parameters into an array.voidGet_Par_All(int[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads all integer parameters into an array.voidGet_Par_Block(int[] Array, int FirstIndex, int Count)Reads a block of integer parameters.voidGet_Par_Block(int[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads a block of integer parameters.intGet_Processdelay(int ProcessNo)Gets the process delay of a process.voidGetData_Double(int DataNo, double[] Data, int FirstIndex, int Count)Reads a part of a double data field.voidGetData_Double(int DataNo, double[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads a part of a double data field.voidGetData_Float(int DataNo, float[] Data, int FirstIndex, int Count)Reads a part of a float data field.voidGetData_Float(int DataNo, float[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads a part of a float data field.voidGetData_Int(int DataNo, int[] Data, int FirstIndex, int Count)Reads a part of an integer data field.voidGetData_Long(int DataNo, int[] Data, int FirstIndex, int Count)Deprecated.useGetData_Int(int, int[], int, int)instead.voidGetData_Long(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Deprecated.useGetData_Int(int, int[], int, int)instead.voidGetData_Long(int DataNo, long[] Data, int FirstIndex, int Count)voidGetData_Long(int DataNo, long[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Reads a part of a long data field.voidGetData_Packed(int DataNo, int[] Data, int FirstIndex, int Count)StringGetData_String(int DataNo)Reads a string data field.intGetData_String(int DataNo, char[] Data, int MaxCount)reads a string data field in acharArray.voidGetFifo_Double(int FifoNo, double[] Data, int Count)Reads some doubles from a fifo.voidGetFifo_Float(int FifoNo, float[] Data, int Count)Reads some floats from a fifo.voidGetFifo_Long(int FifoNo, int[] Data, int Count)Reads some integers from a fifo.voidGetFifo_Packed(int FifoNo, int[] Data, int Count)voidLoad_Process(byte[] file, String fileName)voidLoad_Process(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.voidLoad_Process(URL process)intProcess_Status(int ProcessNo)Gets the information if a process is running.
Return values:
1 Process is running 0 Process is not running.intProcessor_Type()Returns the processor that is installed on the current ADwin system.booleanRemove_Entry(int DevNo)Deletes an entry that has been added withAdd_Entryfrom the device table.voidSanitizeFloatingPointValues(int flag)Instruct the DLL to convert NaN-Values in Single/Double arrays to regular values (usually MAX_FLOAT).voidSet_DeviceNo(int DevNo)Chooses a device from the device table to work with.
Code that anADwinCommunicationErrorpossibly will contain: 4000, 2000voidSet_FPar(int Index, float Value)Sets a float parameter.voidSet_FPar_Double(int Index, double Value)Sets a double parameter.voidSet_Globaldelay(int ProcessNo, int Globaldelay)Deprecated.As of 1.2, replaced bySet_Processdelay(int, int)voidSet_Language(int LanguageID)Sets the language for messages of exceptions.voidSet_Par(int Index, int Value)Sets one of the integer parameters.voidSet_Processdelay(int ProcessNo, int Processdelay)Sets the process delay of a process.voidSetData_Double(int DataNo, double[] Data, int FirstIndex, int Count)Sets a part of a double data field.voidSetData_Double(int DataNo, double[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Sets a part of a double data field.voidSetData_Float(int DataNo, float[] Data, int FirstIndex, int Count)Sets a part of a float data field.voidSetData_Float(int DataNo, float[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Sets a part of a float data field.voidSetData_Long(int DataNo, int[] Data, int FirstIndex, int Count)Sets a part of an integer data field.voidSetData_Long(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)Sets a part of an integer data field.voidSetData_Long(int DataNo, long[] Data, int FirstIndex, int Count)Sets a part of a long (int64) data field.voidSetData_String(int DataNo, String Data)Writes a string into a string data field.voidsetDebugListener(ADwinDebugListener adl)voidSetFifo_Double(int FifoNo, double[] Data, int Count)Writes some doubles into a fifo.voidSetFifo_Float(int FifoNo, float[] Data, int Count)Writes some floats into a fifo.voidSetFifo_Long(int FifoNo, int[] Data, int Count)Writes some integers into a fifo.voidStart_Process(int ProcessNo)Starts a process that has been loaded previously withLoad_Process.voidStop_Process(int ProcessNo)Stops a process.intString_Length(int DataNo)Determines the length of a string.intTest_Version()Tests if an ADwin system is accessible.voidUse_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).
Iftrueis passed forUsage, 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.intWorkload()Returns the CPU load of an ADwin system.
-
-
-
Field Detail
-
LANGID_ENGLISH
public static final int LANGID_ENGLISH
- See Also:
- Constant Field Values
-
LANGID_GERMAN
public static final int LANGID_GERMAN
- See Also:
- Constant Field Values
-
LANGID_SYSDEFAULT
public static final int LANGID_SYSDEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
Add_Entry
public void Add_Entry(int deviceNo, InetAddress ipAddressADwinSystem, String password, int tcpipServerDeviceNo, int port)Appends a new entry to the device table. When a device number has been stored in the device table, it can be used withSet_DeviceNo.
You can use the ADwin TCP/IP-Server under Windows to access USB and Link devices. In this case,ipAddressADwinSystemshould 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.
When using the ADwin TCP/IP-Server, the parametertcpipServerDeviceNoidentifies a Device Number that has been configured with ADconfig on the computer the TCP/IP-Sever runs on.- Parameters:
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)- Throws:
IllegalArgumentException- If the device number already exists- See Also:
Set_DeviceNo(int)
-
Add_Entry
public void Add_Entry(int deviceNo, InetAddress ipAddressADwinSystem, String password, int tcpipServerDeviceNo, int port, int networkTimeout)Appends a new entry to the device table. When a device number has been stored in the device table, it can be used withSet_DeviceNo.
You can use the ADwin TCP/IP-Server under Windows to access USB and Link devices. In this case,ipAddressADwinSystemshould 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.
When using the ADwin TCP/IP-Server, the parametertcpipServerDeviceNoidentifies a Device Number that has been configured with ADconfig on the computer the TCP/IP-Sever runs on.- Parameters:
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.- Throws:
IllegalArgumentException- If the device number already exists- See Also:
Set_DeviceNo(int)
-
Add_Entry
public void Add_Entry(int DevNo, InetAddress IP, String Password, int Timeout, int ADTimeout, int AllowedErrors, int NumWaits, int WaitTime, int Blocksize, int Hostlink, int Port) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
Remove_Entry
public boolean Remove_Entry(int DevNo)
Deletes an entry that has been added withAdd_Entryfrom the device table.- Parameters:
DevNo- Device number that is to be deleted- Returns:
true, if the device number has been found and something was done.- See Also:
Add_Entry(int, java.net.InetAddress, java.lang.String, int, int)
-
Use_FileLocks
public void Use_FileLocks(boolean Usage) throws ADwinCommunicationErrorControls 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).
Iftrueis passed forUsage, 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.
If a newer than the above version is used, multiple Java processes can always access an ADwin-System concurrently, it does not matter wether this flag is set or not, but the time consumption is still there.
Synchronization with lock files is turned off by default.- Parameters:
Usage- passtrueto enable synchronization with disk files, orfalseto disable it.- Throws:
ADwinCommunicationError- If the lock file could not be created
-
Set_Language
public void Set_Language(int LanguageID)
Sets the language for messages of exceptions.- Parameters:
LanguageID-LANGID_SYSDEFAULT (0),LANGID_ENGLISH (1)orLANGID_GERMAN (2)
-
Get_Known_DeviceNo
public int[] Get_Known_DeviceNo()
Returns an array that contains all device numbers that have been added (withAdd_Entry) to this class.- Returns:
- the array
-
Set_DeviceNo
public void Set_DeviceNo(int DevNo) throws ADwinCommunicationErrorChooses a device from the device table to work with.
Code that anADwinCommunicationErrorpossibly will contain: 4000, 2000- Parameters:
DevNo- Device number that is made the current device.- Throws:
IllegalArgumentException- if the device number is not in the device table.ADwinCommunicationError- See Also:
Add_Entry(int, java.net.InetAddress, java.lang.String, int, int),Table of error codes
-
Get_DeviceNo
public int Get_DeviceNo()
Reads the currently active device number.- Returns:
- currently active device number. 0 if there has not been set one yet.
-
Get_Par
public int Get_Par(int Index) throws ADwinCommunicationErrorReads an integer parameter from the ADwin system.
Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 1, 2- Parameters:
Index- Index of the integer parameter to read.- Returns:
- The current value of the int variable Par_x on the ADwin system.
- Throws:
IllegalArgumentException- ifIndexis too high.ADwinCommunicationError- See Also:
Get_FPar(int),Set_Par(int, int),Table of error codes
-
GetData_Packed
public void GetData_Packed(int DataNo, int[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsException
-
GetFifo_Packed
public void GetFifo_Packed(int FifoNo, int[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsException
-
Processor_Type
public int Processor_Type() throws ADwinCommunicationErrorReturns the processor that is installed on the current ADwin system. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 1, 2- Returns:
- The number of the installed processor. T + the returned number gives the processor type.
- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
GetData_Int
public void GetData_Int(int DataNo, int[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads a part of an integer data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Long(int, int[], int, int),Table of error codes
-
GetData_Long
@Deprecated public void GetData_Long(int DataNo, int[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsException
Deprecated.useGetData_Int(int, int[], int, int)instead.Reads a part of an integer (32 bit) data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Long(int, int[], int, int),Table of error codes
-
GetData_Long
public void GetData_Long(int DataNo, long[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsException
-
GetData_Long
@Deprecated public void GetData_Long(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsException
Deprecated.useGetData_Int(int, int[], int, int)instead.Reads a part of an integer data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Long(int, int[], int, int),Table of error codes
-
GetData_Long
public void GetData_Long(int DataNo, long[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads a part of a long data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Long(int, int[], int, int),Table of error codes
-
GetData_Float
public void GetData_Float(int DataNo, float[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads a part of a float data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Float(int, float[], int, int),Table of error codes
-
GetData_Float
public void GetData_Float(int DataNo, float[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads a part of a float data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Float(int, float[], int, int),Table of error codes
-
GetData_Double
public void GetData_Double(int DataNo, double[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads a part of a double data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Double(int, double[], int, int),Table of error codes
-
GetData_Double
public void GetData_Double(int DataNo, double[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads a part of a double data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- If DataNo is out of range (1 <= DataNo <= 200)IndexOutOfBoundsException- If Data is too small- See Also:
SetData_Double(int, double[], int, int),Table of error codes
-
SetData_Long
public void SetData_Long(int DataNo, int[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of an integer data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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 set- Throws:
ADwinCommunicationError- If no device is setIllegalArgumentException- If the data field is not of type int, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Long(int, int[], int, int),Table of error codes
-
SetData_Long
public void SetData_Long(int DataNo, long[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of a long (int64) data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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 set- Throws:
ADwinCommunicationErrorIllegalArgumentException- If the data field is not of type int, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Long(int, int[], int, int),Table of error codes
-
SetData_Long
public void SetData_Long(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of an integer data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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-based- Throws:
ADwinCommunicationErrorIllegalArgumentException- If the data field is not of type int, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Long(int, int[], int, int),Table of error codes
-
SetData_Float
public void SetData_Float(int DataNo, float[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of a float data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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 set- Throws:
ADwinCommunicationErrorIllegalArgumentException- If the data field is not of type int, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Float(int, float[], int, int),Table of error codes
-
SetData_Float
public void SetData_Float(int DataNo, float[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of a float data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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-based- Throws:
ADwinCommunicationErrorIllegalArgumentException- If the data field is not of type int, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Float(int, float[], int, int),Table of error codes
-
SetData_Double
public void SetData_Double(int DataNo, double[] Data, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of a double data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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 set- Throws:
ADwinCommunicationErrorIllegalArgumentException- If the data field is not of type double, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Double(int, double[], int, int),Table of error codes
-
SetData_Double
public void SetData_Double(int DataNo, double[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentExceptionSets a part of a double data field. Note that the first index in ADbasic arrays is 1. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1- Parameters:
DataNo- 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-based- Throws:
ADwinCommunicationErrorIllegalArgumentException- If the data field is not of type double, or ifFirstIndexandCountdo not match the size of the field.- See Also:
GetData_Double(int, double[], int, int),Table of error codes
-
Set_Par
public void Set_Par(int Index, int Value) throws ADwinCommunicationErrorSets one of the integer parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Index- Number of the parameter to setValue- new value for the parameter- Throws:
IllegalArgumentException- IfIndexis too highADwinCommunicationError- See Also:
Table of error codes,Table of error codes
-
Get_Par_Block
public void Get_Par_Block(int[] Array, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionReads a block of integer parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are storedFirstIndex- Index of the first parameter to readCount- number of parameters to read.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFirstIndexorCountare negative, or are too big- See Also:
Table of error codes
-
Get_Par_Block
public void Get_Par_Block(int[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentExceptionReads a block of integer parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
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.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFirstIndexorCountare negative, or are too big- See Also:
Table of error codes
-
Get_FPar_Block
public void Get_FPar_Block(float[] Array, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionReads a block of float parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are storedFirstIndex- Index of the first parameter to readCount- number of parameters to read.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFirstIndexorCountare negative, or are too big- See Also:
Table of error codes
-
Get_FPar_Block
public void Get_FPar_Block(float[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentExceptionReads a block of float parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
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- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFirstIndexorCountare negative, or are too big- See Also:
Table of error codes
-
Get_FPar_Block_Double
public void Get_FPar_Block_Double(double[] Array, int FirstIndex, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionReads a block of double parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are storedFirstIndex- Index of the first parameter to readCount- number of parameters to read.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFirstIndexorCountare negative, or are too big- See Also:
Table of error codes
-
Get_FPar_Block_Double
public void Get_FPar_Block_Double(double[] Array, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationError, IllegalArgumentExceptionReads a block of double parameters. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
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- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFirstIndexorCountare negative, or are too big- See Also:
Table of error codes
-
Data_Length
public int Data_Length(int DataNo) throws ADwinCommunicationErrorReads the length of a data field. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 100, 2000, 2, 1.- Parameters:
DataNo- Number of the data from which the length should be read.- Returns:
- length of the data field.
- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Fifo_Empty
public int Fifo_Empty(int FifoNo) throws ADwinCommunicationErrorReads the number of free elements in a fifo. If the fifo does not exist, 0 will be returned. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
FifoNo- Number of the fifo whose number of free elements is to be determined.- Returns:
- Number of free elements in the fifo
- Throws:
IllegalArgumentException- IfFifoNois not in the range [1, 200]ADwinCommunicationError- See Also:
Table of error codes
-
Fifo_Full
public int Fifo_Full(int FifoNo) throws ADwinCommunicationErrorReads the number of elements that have been written to a fifo, and have not been read yet. If the fifo does not exist, 0 will be returned. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
FifoNo- Number of the fifo whose number of used elements is to be determined.- Returns:
- Number of used elements in the fifo
- Throws:
IllegalArgumentException- IfFifoNois not in the range [1, 200]ADwinCommunicationError- See Also:
Table of error codes
-
Fifo_Clear
public void Fifo_Clear(int FifoNo) throws ADwinCommunicationErrorRemoves all values from a fifo that have been written to it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
FifoNo- Fifo that will be cleared- Throws:
IllegalArgumentException- IfFifoNois not in the range [1, 200].ADwinCommunicationError- See Also:
Table of error codes
-
SetFifo_Long
public void SetFifo_Long(int FifoNo, int[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionWrites some integers into a fifo. One can useFifo_Emptyto check if there is enough space left in it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 101, 2000, 2, 1.- Parameters:
FifoNo- Number of the fifo to write to.Data- Array that contains the data to writeCount- Number of elements to write.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFifoNois not the number of an integer fifo- See Also:
Table of error codes,Fifo_Empty(int)
-
SetFifo_Float
public void SetFifo_Float(int FifoNo, float[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionWrites some floats into a fifo. One can useFifo_Emptyto check if there is enough space left in it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 101, 2000, 2, 1.- Parameters:
FifoNo- Number of the fifo to write to.Data- Array that contains the data to writeCount- Number of elements to write.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFifoNois not the number of a float fifo- See Also:
Table of error codes,Fifo_Empty(int)
-
SetFifo_Double
public void SetFifo_Double(int FifoNo, double[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentExceptionWrites some doubles into a fifo. One can useFifo_Emptyto check if there is enough space left in it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 101, 2000, 2, 1.- Parameters:
FifoNo- Number of the fifo to write to.Data- Array that contains the data to writeCount- Number of elements to write.- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfFifoNois not the number of a float fifo- See Also:
Table of error codes,Fifo_Empty(int)
-
Get_Par_All
public void Get_Par_All(int[] Array) throws ADwinCommunicationErrorReads all integer parameters into an array. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are stored. Its size must be >= 80.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Get_Par_All
public void Get_Par_All(int[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationErrorReads all integer parameters into an array. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1. or one-based.- Parameters:
Array- Array, where the parameters are stored. Its size must be >FirstArrayIndex- specify if the returned array should be zero-based * 80.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Get_FPar_All
public void Get_FPar_All(float[] Array) throws ADwinCommunicationErrorReads all float parameters into an array. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are stored. Its size must be >= 80.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Get_FPar_All
public void Get_FPar_All(float[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationErrorReads all float parameters into an array. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are stored. Its size must be >=FirstArrayIndex- specify if the returned array should be zero-based 80.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Get_FPar_All_Double
public void Get_FPar_All_Double(double[] Array) throws ADwinCommunicationErrorReads all double parameters into an array. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are stored. Its size must be >= 80.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Get_FPar_All_Double
public void Get_FPar_All_Double(double[] Array, ADwinDevice.first_pcarray_index_t FirstArrayIndex) throws ADwinCommunicationErrorReads all double parameters into an array. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Array- Array, where the parameters are stored. Its size must be >=FirstArrayIndex- specify if the returned array should be zero-based 80.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
GetFifo_Long
public void GetFifo_Long(int FifoNo, int[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads some integers from a fifo. One can useFifo_Fullto check if there have enough elements been written to it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 102, 2, 1.- Parameters:
FifoNo- Number of the fifo to read out.Data- Array where the data from the fifo is storedCount- Number of elements to read- Throws:
ADwinCommunicationErrorIndexOutOfBoundsException- If Data is too smallIllegalArgumentException- See Also:
Table of error codes,Fifo_Full(int)
-
GetFifo_Float
public void GetFifo_Float(int FifoNo, float[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads some floats from a fifo. One can useFifo_Fullto check if there have enough elements been written to it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 102, 2, 1.- Parameters:
FifoNo- Number of the fifo to read out.Data- Array where the data from the fifo is storedCount- Number of elements to read- Throws:
ADwinCommunicationErrorIndexOutOfBoundsException- If Data is too smallIllegalArgumentException- See Also:
Table of error codes,Fifo_Full(int)
-
GetFifo_Double
public void GetFifo_Double(int FifoNo, double[] Data, int Count) throws ADwinCommunicationError, IllegalArgumentException, IndexOutOfBoundsExceptionReads some doubles from a fifo. One can useFifo_Fullto check if there have enough elements been written to it. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 102, 2, 1.- Parameters:
FifoNo- Number of the fifo to read out.Data- Array where the data from the fifo is storedCount- Number of elements to read- Throws:
ADwinCommunicationErrorIndexOutOfBoundsException- If Data is too smallIllegalArgumentException- See Also:
Table of error codes,Fifo_Full(int)
-
Get_FPar
public float Get_FPar(int Index) throws ADwinCommunicationErrorReads a float parameter from the ADwin system. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Index- Number of the float parameter to read- Returns:
- Value of the float parameter
- Throws:
ADwinCommunicationErrorIllegalArgumentException- ifIndexis not in the range [1, 80]- See Also:
Table of error codes,Set_FPar(int, float)
-
Get_FPar_Double
public double Get_FPar_Double(int Index) throws ADwinCommunicationErrorReads a double parameter from the ADwin system. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Index- Number of the float parameter to read- Returns:
- Value of the float parameter
- Throws:
ADwinCommunicationErrorIllegalArgumentException- ifIndexis not in the range [1, 80]- See Also:
Table of error codes,Set_FPar(int, float)
-
Set_FPar
public void Set_FPar(int Index, float Value) throws ADwinCommunicationErrorSets a float parameter. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Index- Number of the float parameter to setValue- New Value for the parameter- Throws:
ADwinCommunicationErrorIllegalArgumentException- ifIndexis not in the range [1, 80]- See Also:
Table of error codes,Get_FPar(int)
-
Set_FPar_Double
public void Set_FPar_Double(int Index, double Value) throws ADwinCommunicationErrorSets a double parameter. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Index- Number of the double parameter to setValue- New Value for the parameter- Throws:
ADwinCommunicationErrorIllegalArgumentException- ifIndexis not in the range [1, 80]- See Also:
Table of error codes,Get_FPar_Double(int)
-
Workload
public int Workload() throws ADwinCommunicationErrorReturns the CPU load of an ADwin system. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Returns:
- CPU load
- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Free_Mem
public int Free_Mem(int Mem_Spec) throws ADwinCommunicationErrorReturns the amount of free RAM of an ADwin system in bytes.
Mem_Specdetermines 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
ADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
Mem_Spec- Kind of memory- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Load_Process
public void Load_Process(String Filename) throws ADwinCommunicationError
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. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 205, 202, 200, 2, 1.- Parameters:
Filename- Name of the file to load- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Start_Process
public void Start_Process(int ProcessNo) throws ADwinCommunicationErrorStarts a process that has been loaded previously withLoad_Process.Process_Statuscan be used to determine if a process has been started. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
ProcessNo- Number of the process that will be started.- Throws:
ADwinCommunicationError- See Also:
Table of error codes,Process_Status(int)
-
Stop_Process
public void Stop_Process(int ProcessNo) throws ADwinCommunicationErrorStops a process. It must have been started withStart_Process, and can be resumed withStart_Process. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
ProcessNo- Number of the process to stop- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Clear_Process
public void Clear_Process(int ProcessNo) throws ADwinCommunicationErrorDeletes a process and frees all resources that were allocated by it. A process must have been stopped withStop_Processbefore it can be deleted.Process_Statuscan be used to determine if the process is still running. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
ProcessNo- Number of the process that will be deleted- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfProcessNois not in the range [1, 15]- See Also:
Table of error codes,Stop_Process(int)
-
Process_Status
public int Process_Status(int ProcessNo) throws ADwinCommunicationErrorGets the information if a process is running.
Return values:
Code that an1 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. ADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
ProcessNo- Number of the process that will be checked- Returns:
- State of the process according to the table above
- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfProcessNois not in the range [1, 15].- See Also:
Table of error codes
-
Boot
public void Boot(String Filename) throws ADwinCommunicationError
Boots an ADwin system and loads an operating system. An operating systems is a file with the extension .btl. If a wrong OS is loaded (the <x> in the file ADwin<x>.btl does not match the CPU number), any following call will fail with code 1 or 2, until the ADwin system is rebooted with the correct operating system file. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 204, 200, 2, 1.- Parameters:
Filename- Name of the file that contains the operating system that will be loaded.- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
GetData_String
public String GetData_String(int DataNo) throws ADwinCommunicationError
Reads a string data field.SetData_Stringcan be used to write a string. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1.- Parameters:
DataNo- Number of the data field to read.- Returns:
- The string that was read
- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfDataNois out of range, or if dataDataNois not of type int.- See Also:
Table of error codes,SetData_String(int, java.lang.String)
-
GetData_String
public int GetData_String(int DataNo, char[] Data, int MaxCount) throws ADwinCommunicationErrorreads a string data field in acharArray. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 100, 2, 1.- Parameters:
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 thanMaxCount, fewer characters are read.- Returns:
- Number of bytes read.
- Throws:
IllegalArgumentException- IfDataNois out of range, or if dataDataNois not of type int.ADwinCommunicationError
-
SetData_String
public void SetData_String(int DataNo, String Data) throws ADwinCommunicationError, IllegalArgumentExceptionWrites a string into a string data field.GetData_Stringcan be used to read a string. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
DataNo- Number of the data field that will be written to.Data- String that will be written- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfDataNois out of range.- See Also:
Table of error codes,GetData_String(int)
-
String_Length
public int String_Length(int DataNo) throws ADwinCommunicationErrorDetermines the length of a string. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
DataNo- Number of the string data field.- Returns:
- length of the string that is stored in
DataNo. - Throws:
ADwinCommunicationErrorIllegalArgumentException- IfDataNois out of range.IllegalArgumentException- IfDataNois out of range- See Also:
Table of error codes
-
Set_Globaldelay
public void Set_Globaldelay(int ProcessNo, int Globaldelay) throws ADwinCommunicationErrorDeprecated.As of 1.2, replaced bySet_Processdelay(int, int)- Parameters:
ProcessNo- number of the process whose process delay is setGlobaldelay- new process delay- Throws:
ADwinCommunicationError
-
Set_Processdelay
public void Set_Processdelay(int ProcessNo, int Processdelay) throws ADwinCommunicationErrorSets the process delay of a process. It does not matter if the process is running or not. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
ProcessNo- number of the process whose process delay is setProcessdelay- new process delay- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfProcessNoexceeds the valid range- See Also:
Table of error codes,Get_Processdelay(int)
-
Get_Globaldelay
public int Get_Globaldelay(int ProcessNo) throws ADwinCommunicationErrorDeprecated.As of 1.2, replaced byGet_Processdelay(int)- Parameters:
ProcessNo- The Processnumber- Returns:
- The cycle time (called ProcessDelay) of a process on the ADwin system.
- Throws:
ADwinCommunicationError
-
Get_Processdelay
public int Get_Processdelay(int ProcessNo) throws ADwinCommunicationErrorGets the process delay of a process. It can have been set withSet_Processdelay, or (ifSet_Processdelayhas not been used yet) the process delay returned is the setting stored in the binary ADbasic file. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 2, 1.- Parameters:
ProcessNo- The Processnumber- Returns:
- The cycle time (called ProcessDelay) of a process on the ADwin system.
- Throws:
ADwinCommunicationErrorIllegalArgumentException- IfProcessNoexceeds the valid range- See Also:
Table of error codes,Set_Processdelay(int, int)
-
setDebugListener
public void setDebugListener(ADwinDebugListener adl)
-
Test_Version
public int Test_Version() throws ADwinCommunicationErrorTests if an ADwin system is accessible. Can be used withBootto determine if the correct BTL file was loaded. Code that anADwinCommunicationErrorpossibly will contain: 4000.- Returns:
- 0, if the ADwin system responds, 3 if it does not respond or responds with errors
- Throws:
ADwinCommunicationError- See Also:
Table of error codes,Boot(java.lang.String)
-
Data2File
public void Data2File(String Filename, int DataNo, int Startindex, int Count, int Mode) throws ADwinCommunicationError
Reads a data field and stores or appends it to a file. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 205, 100, 2, 1.- Parameters:
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 file- Throws:
IllegalArgumentException- IfModeis not 0 or 1.ADwinCommunicationError- See Also:
Table of error codes
-
File2Data
public void File2Data(String Filename, int DataType, int DataNo, int Startindex) throws ADwinCommunicationError, IllegalArgumentException
File2Data copies values from a file (on the hard disk) into a DATA array of the ADwin system. Code that anADwinCommunicationErrorpossibly will contain: 4000, 2002, 2000, 205, 100, 2, 1.- Parameters:
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.- Throws:
IllegalArgumentException- IfDataTypeis not 3, 5 or 6.ADwinCommunicationError- See Also:
Table of error codes
-
Data_Type
public int Data_Type(int DataNo) throws ADwinCommunicationErrorDelivers the type of a data- Parameters:
DataNo- Number of the data- Returns:
- datatype (1: int8, 2: int16, 3/4: int32, 5: float, 6: double, 7: int64, 8: string)
- Throws:
ADwinCommunicationError- See Also:
Table of error codes
-
Get_Copy
public ADwinDevice Get_Copy()
Creates an independent copy of this object. After creation of the new object, the methodSet_DeviceNomust 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.- Returns:
- The copy
-
Boot
public void Boot(byte[] File, String Filename) throws ADwinCommunicationError, IOException- Throws:
ADwinCommunicationErrorIOException
-
Load_Process
public void Load_Process(byte[] file, String fileName) throws ADwinCommunicationError- Throws:
ADwinCommunicationError
-
Boot
public void Boot(URL btl) throws ADwinCommunicationError, IOException
- Throws:
ADwinCommunicationErrorIOException
-
Load_Process
public void Load_Process(URL process) throws ADwinCommunicationError
- Throws:
ADwinCommunicationError
-
SanitizeFloatingPointValues
public void SanitizeFloatingPointValues(int flag)
Instruct the DLL to convert NaN-Values in Single/Double arrays to regular values (usually MAX_FLOAT). Note: default is to sanitize values (flag = 1).- Parameters:
flag-
-
-