Class 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 the 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.
    See Also:
    Add_Entry(int, java.net.InetAddress, java.lang.String, int, int), ADwinCommunicationError.getCode()
    • Constructor Summary

      Constructors 
      Constructor Description
      ADwinDevice()
      Construct a new ADwinDevice object, the language for Exceptions etc. is set to English, except when Locale.getDefault ().getISO3Language ().compareTo ("deu") !
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void Add_Entry​(int deviceNo, InetAddress ipAddressADwinSystem, String password, int tcpipServerDeviceNo, int port)
      Appends a new entry to the device table.
      void Add_Entry​(int deviceNo, InetAddress ipAddressADwinSystem, String password, int tcpipServerDeviceNo, int port, int networkTimeout)
      Appends a new entry to the device table.
      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)  
      void Boot​(byte[] File, String Filename)  
      void Boot​(String Filename)
      Boots an ADwin system and loads an operating system.
      void Boot​(URL btl)  
      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​(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​(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.
      float Get_FPar​(int Index)
      Reads a float parameter from the ADwin system.
      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_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_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.
      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.
      double Get_FPar_Double​(int Index)
      Reads a double 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.
      int Get_Par​(int Index)
      Reads an integer parameter from the ADwin system.
      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_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_Int​(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)
      Deprecated.
      void GetData_Long​(int DataNo, int[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)
      Deprecated.
      void GetData_Long​(int DataNo, long[] Data, int FirstIndex, int Count)  
      void GetData_Long​(int DataNo, long[] Data, int FirstIndex, int Count, ADwinDevice.first_pcarray_index_t FirstArrayIndex)
      Reads a part of a long data field.
      void GetData_Packed​(int DataNo, int[] Data, int FirstIndex, int Count)  
      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 GetFifo_Packed​(int FifoNo, int[] Data, int Count)  
      void Load_Process​(byte[] file, String fileName)  
      void Load_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.
      void Load_Process​(URL process)  
      int Process_Status​(int ProcessNo)
      Gets the information if a process is running.
      Return values:
      1    Process is running 0 Process is not 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 SanitizeFloatingPointValues​(int flag)
      Instruct the DLL to convert NaN-Values in Single/Double arrays to regular values (usually MAX_FLOAT).
      void Set_DeviceNo​(int DevNo)
      Chooses a device from the device table to work with.
      Code that an ADwinCommunicationError possibly will contain: 4000, 2000
      void Set_FPar​(int Index, float Value)
      Sets a float parameter.
      void Set_FPar_Double​(int Index, double Value)
      Sets a double 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_Long​(int DataNo, long[] Data, int FirstIndex, int Count)
      Sets a part of a long (int64) data field.
      void SetData_String​(int DataNo, String Data)
      Writes a string into a string data field.
      void setDebugListener​(ADwinDebugListener adl)  
      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).
      If 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.
      int Workload()
      Returns the CPU load of an ADwin system.