Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
waveforms:ref_manual [2014/09/23 23:49] – [10Digital Out (Pattern Generator)] Joshua Woldstadwaveforms:ref_manual [2021/10/13 21:06] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 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. 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.+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. The WaveForms software, as well as the SDK, can be downloaded for free at the [[https://digilent.com/shop/software/digilent-waveforms/| Digilent website]].
  
 {{ :waveforms:ove1.png?600 |}} {{ :waveforms:ove1.png?600 |}}
Line 1063: Line 1063:
 | **FUNC Constants**  | **FUNC Constant Capabilities**                                | | **FUNC Constants**  | **FUNC Constant Capabilities**                                |
 | **funcDC**          | Generate DC value set as offset.                              | | **funcDC**          | Generate DC value set as offset.                              |
-| **FuncSine**        | Generate sine waveform.                                       |+| **funcSine**        | Generate sine waveform.                                       |
 | **funcSquare**      | Generate square waveform.                                     | | **funcSquare**      | Generate square waveform.                                     |
 | **funcTriangle**    | Generate triangle waveform.                                   | | **funcTriangle**    | Generate triangle waveform.                                   |
Line 1071: Line 1071:
 | **funcCustom**      | Generate waveform from custom repeated data.                  | | **funcCustom**      | Generate waveform from custom repeated data.                  |
 | **funcPlay**        | Generate waveform from custom data in stream play style.      | | **funcPlay**        | Generate waveform from custom data in stream play style.      |
 +
  
  
Line 1188: Line 1189:
 The function above is used to obtain the symmetry (or duty cycle) range (0..100). This symmetry is supported for standard signal types. It the pulse duration divided by the pulse period. The function above is used to obtain the symmetry (or duty cycle) range (0..100). This symmetry is supported for standard signal types. It the pulse duration divided by the pulse period.
  
-|**FDwfAnalogOutNodeSymmetrySet**(HDWF hdwf, int idxChannel, AnalogOutNode node, AnalogOutNode node, double percentageSymmetry)| +| **FDwfAnalogOutNodeSymmetrySet**(HDWF hdwf, int idxChannel, AnalogOutNode node, double percentageSymmetry)  
-|Parameters:+| Parameters:                                                                                                 
-|- hdwf – Open interface handle on a device.| +| - hdwf – Open interface handle on a device.                                                                 
-|- idxChannel – Channel index.| +| - idxChannel – Channel index.                                                                               
-|- node – Node index.| +| - node – Node index.                                                                                        
-|- percentageSymmetry –Value of percentage of Symmetry (duty cycle).|+| - percentageSymmetry –Value of percentage of Symmetry (duty cycle).                                         | 
  
 The function above is used to set the symmetry (or duty cycle) for the specified channel-node on the instrument. The function above is used to set the symmetry (or duty cycle) for the specified channel-node on the instrument.
Line 2212: Line 2214:
 The function above is used to verify if a specific channel output mode.  The function above is used to verify if a specific channel output mode. 
  
 +|**FDwfDigitalOutTypeInfo**(HDWF hdwf, int idxChannel, int *pfsDwfDigitalOutType)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- pfsDwfDigitalOutType – Pointer to variable to receive the supported output types.|
 +
 +The function above returns the supported types of the channel. They are returned (by reference) as a bit field. This bit field can be parsed using the IsBitSet Macro. Individual bits are defined using the DwfDigitalOutType constants in dwf.h:
 +DwfDigitalOutTypePulse: Frequency = internal frequency/divider/(low + high counter).
 +DwfDigitalOutTypeCustom: Sample rate = internal frequency / divider.
 +DwfDigitalOutTypeRandom: Random update rate  = internal frequency/divider/counter alternating between low and high values.
 +
 +
 +|**FDwfDigitalOutTypeSet**(HDWF hdwf, int idxChannel, DwfDigitalOutType v)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- v – Output mode.|
 +
 +The function above sets the output type of the specified channel.
 +
 +|**FDwfDigitalOutTypeGet**(HDWF hdwf, int idxChannel, DwfDigitalOutType *pv)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- pfEnable – Pointer to variable to receive enabled state.|
 +
 +The function above is used to verify the type of a specific channel.
 +
 +|**FDwfDigitalOutIdleInfo**(HDWF hdwf, int idxChannel, int *pfsDwfDigitalOutIdle) |
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- pfsDwfDigitalOutIdle – Pointer to variable to receive the supported idle output types.|
 +
 +The function above returns the supported idle output types of the channel. They are returned (by reference) as a bit field. This bit field can be parsed using the IsBitSet Macro. Individual bits are defined using the   * DwfDigitalOutIdle constants in dwf.h. Output while not running:
 +  * DwfDigitalOutIdleInit: Output initial value.
 +  * DwfDigitalOutIdleLow: Low level.
 +  * DwfDigitalOutIdleHigh:  High level.
 +  * DwfDigitalOutIdleZet: Three state.
 +
 +
 +|**FDwfDigitalOutIdleSet**(HDWF hdwf, int idxChannel, DwfDigitalOutIdle v)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- v – Value to set idle output.|
 +
 +The function above sets the idle output of the specified channel.
 +
 +|**FDwfDigitalOutIdleGet**(HDWF hdwf, int idxChannel, DwfDigitalOutIdle *pv)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- pv – Pointer to variable to receive configured value.|
 +
 +The function above is used to verify the idle output of a specific channel.
 +
 +|**FDwfDigitalOutDividerInfo**(HDWF hdwf, int idxChannel, unsigned int *vMin, unsigned int *vMax)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- pnMin – Variable to receive the supported minimum divider value.|
 +|- pnMax – Variable to receive the supported maximum divider value. |
 +
 +The function above is used to return the supported clock divider value range. 
 +
 +|**FDwfDigitalOutDividerInitSet**(HDWF hdwf, int idxChannel, unsigned int v)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- v – Divider initial value. |
 +
 +The function above sets the initial divider value of the specified channel.
 +
 +|**FDwfDigitalOutDividerInitGet**(HDWF hdwf, int idxChannel, unsigned int *pv)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- pv – Pointer to variable to receive configured value.|
 + 
 +The function above is used to verify the initial divider value of the specified channel.
 +
 +|**FDwfDigitalOutDividerSet**(HDWF hdwf, int idxChannel, unsigned int v)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- v – Divider value. |
 +
 +The function above sets the divider value of the specified channel.
 +
 +|**FDwfDigitalOutDividerGet**(HDWF hdwf, int idxChannel, unsigned int *pv)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- pv – Pointer to variable to receive configured value. |
 +
 +The function above is used to verify the divider value of the specified channel.
 +
 +|**FDwfDigitalOutCounterInfo**(HDWF hdwf, int idxChannel, unsigned int *vMin, unsigned int *vMax)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- pnMin – Variable to receive the supported minimum counter value.|
 +|- pnMax – Variable to receive the supported maximum counter value. |
 +
 +The function above is used to return the supported counter value range. 
 +
 +|**FDwfDigitalOutCounterInitSet**(HDWF hdwf, int idxChannel, BOOL fHigh, unsigned int v)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index.|
 +|- fHigh – Start high. |
 +|- v – Divider initial value.|
 +
 +The function above sets the initial state and counter value of the specified channel. 
 +
 +|**FDwfDigitalOutCounterInitGet**(HDWF hdwf, int idxChannel, int* pfHigh, unsigned int *pv)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- pfHigh – Pointer to variable to receive configured value. |
 +|- pv – Pointer to variable to receive configured value. |
 +
 +The function above is used to verify the initial state and counter value of the specified channel.
 +
 +|**FDwfDigitalOutCounterSet**(HDWF hdwf, int idxChannel, unsigned int vLow, unsigned int vHigh)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- vLow – Counter low value.|
 +|- vHigh – Counter high value. |
 +
 +The function above sets the counter low and high values of the specified channel.
 +
 +|**FDwfDigitalOutCounterGet**(HDWF hdwf, int idxChannel, unsigned int *pvLow, unsigned int *pvHigh)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- pvLow – Pointer to variable to receive configured value. |
 +|- pvHigh – Pointer to variable to receive configured value. |
 +
 +The function above is used to verify the low and high counter value of the specified channel.
 +
 +|**FDwfDigitalOutDataInfo**(HDWF hdwf, int idxChannel, unsigned int *pcountOfBitsMax)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- pcountOfBitsMax – Variable to receive the maximum number of bits.|
 +
 +The function above is used to return the maximum buffers size, the number of custom data bits.
 +
 +|**FDwfDigitalOutDataSet**(HDWF hdwf, int idxChannel, void *rgBits, unsigned int countOfBits)|
 +|Parameters: |
 +|- hdwf – Interface handle.|
 +|- idxChannel – Channel index. |
 +|- rgBits – Custom data array. |
 +|- countOfBits –Number of bits.|
 +
 +The function above is used to set the custom data bits. The function also sets the counter initial, low and high value, according the number of bits. The data bits are sent out in LSB first order. For TS output, the count of bits is the total number of output value (I/O) and output enable (OE) bits, which should be an even number.
 +
 +|  Custom Data Bits                                                                        ||||||||||
 +| **BYTE**           | 0              |        |        |      |        | 1              |      |
 +| **Bits**           | 0       | 1      | 2      | 3      | ...  | 7      | 0       | 1      | ...  |
 +| **Output**         | I/O(0)  | OE(0)  | IE(1)  | OE(1)  | ...  | OE(3)  | I/O(4)  | OE(4)  | ...  |