This is an old revision of the document!


Overview

WaveForms™ provides an interface that allows users to interact with Digilent Analog Design hardware, such as the Analog Discovery™ and Electronics Explorer™. While the WaveForms application offers a refined graphical interface, the WaveForms SDK provides access to a public application programming interface (API) that gives users the ability to create custom PC applications. This WaveForms SDK manual describes the main components and architecture of the WaveForms system and details each function contained in the WaveForms API. The SDK package also offers examples demonstrating how to identify, connect to, and control analog hardware devices.


1 The System

The WaveForms system is comprised of multiple components. The most visible component is the WaveForms Application; a suite of graphical instrument panels that give full access to the analog and digital instruments in the connected hardware. The WaveForms application uses the WaveForms Runtime to control all signal generation and acquisition. The WaveForms Runtime is comprised of the DWF Dynamic Library and several configuration files. This library is located in:

  • Windows in System Directory: C: \Windows\System32\dwf.dll
  • Linux: /usr/lib/libdwf.so.x.x.x

The static library is located on Windows in the install path:

  • Windows 32bit: C:\Program Files\Digilent\WaveFormsSDK\lib\x86
  • Windows 64bit: C:\Program Files (x86)\Digilent\WaveFormsSDK\lib\x64

The C header file is located in:

  • Windows: C:\Program Files\Digilent\WaveFormsSDK\inc
  • Windows 64bit: C:\Program Files (x86)\Digilent\WaveFormsSDK\inc
  • Linux: /usr/local/include/digilent/waveforms

Working code examples are provided with the SDK to demonstrate basic use of each API function set. You can find samples in the installation directory, which are located here:

  • Windows 32bit: C:\Program Files\Digilent\WaveFormsSDK\samples
  • Windows 64bit: C:\Program Files (x86)\Digilent\WaveFormsSDK\samples
  • Linux: /usr/local/share/digilent/waveforms/samples

The DWF Library uses the Adept Runtime, which provides basic communication with the targeted hardware instruments (i.e. Analog Discovery and Electronics Explorer). Although the Adept Runtime is an integral part of the WaveForms System, knowledge of its structure is not required to write custom applications.

The requirements for Linux version are the libusb-1.0-0, Digilent Adept Runtime, and the included FTDI drivers:

$ sudo apt-get install linusb-1.0-0 digilent.adept.runtime_#/ftdi.drivers_# $ sudo bash install.sh digilent.adept.runtime_# $ sudo bash install.sh

1.1 The API

Everything needed to write custom applications is included in the WaveForms SDK, which provides the header/library files and documentation to access the API for the DWF Library. A custom application must properly link to these files to make the appropriate API function calls. Every function in the WaveForms public API is declared in the dwf.h header file.

Basic usage of the WaveForms API can be broken down into the following steps:

  1. Call enumeration functions to discover connected hardware devices.
  2. Call FDwfDeviceOpen function to establish a connection to specific hardware device.
  3. Call function to enable instrument within hardware device.
  4. Call functions to configure instrument and acquire/generate signals.
  5. Call function to disable instrument.
  6. Call FDwfDeviceClose function to disconnect from device.

There are nine main groups of API functions, each named with different prefixes:

Main Groups of API Functions Instrument Function Prefix
Device Enumeration Controls the enumeration of connected and supported devices. DwfEnum
Device Control Controls opening and closing specific devices. DwfDevice
AnalogIn (Oscilloscope) Acquires samples from each enabled channel synchronously. DfwAnalogIn
AnalogOut (Arbitrary Waveform Generator) Drives signals from each channel independently. DfwAnalogOut
AnalogIO Acquires and drives various analog signals. DfwAnalogIO
DigitalIn (Logic Analyzer) Acquires samples from digital I/O pins. DfwDigitalIn
DigitalOut (Pattern Generator) Drives digital I/O signals. DfwDigitalOut
DigitalIO Acquires and drives digital I/O signals. DfwDigitalIO
System Obtain basic system information that is instrument and device independent. DfwGet

Each instrument is directly controlled using three types of functions in the API:

API Functions Instrument Function Example
Reset function This function resets all of the instrument parameters to default values.
Configure function This function configures and/or starts the instrument.
Status function This function polls and reads all information from the instrument.