300 Henley Court Pullman, WA 99163 509.334.6306 www.digilentinc.com WaveForms™ SDK Reference Manual Revised January 26, 2015 Table of Contents Table of Contents .................................................................................................................. 1 Overview............................................................................................................................... 2 1 The System ................................................................................
WaveForms™ SDK Reference Manual Overview TM WaveForms provides an interface that allows users to interact with Digilent Analog Design hardware, such as the TM TM 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™ SDK Reference Manual The static library is located in Windows through the install path: Windows 32-bit: C:\Program Files\Digilent\WaveFormsSDK\lib\x86 Windows 64-bit: C:\Program Files (x86)\Digilent\WaveFormsSDK\lib\x64 The C header file is located in: Windows: C:\Program Files\Digilent\WaveFormsSDK\inc Windows 64-bit: C:\Program Files (x86)\Digilent\WaveFormsSDK\inc Linux: /usr/include/digilent/waveforms Working code examples are provided with the SDK to demonstrate basic use of ea
WaveForms™ SDK Reference Manual 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.
WaveForms™ SDK Reference Manual Each instrument is directly controlled using three types of functions in the API: API Functions Instrument Function Example FDwfAnalogInReset Reset function This function resets all of the instrument parameters to default values. FDwfAnalogOutReset FDwfDigitalIOReset FDwfAnalogInConfigure Configure function This function configures and/or starts the instrument.
WaveForms™ SDK Reference Manual 1.2 Calling API Functions The API functions are C style and return a Boolean value: TRUE if the call is successful, FALSE if unsuccessful. This Boolean value is an integer type definition, not the standard c-type bool. In general, the API functions contain variations of the following parameters: Parameters Parameter Function *Info Returns detailed information about the parameter support for the instrument (i.e., minimum/maximum values, supported modes, etc.
WaveForms™ SDK Reference Manual 2 System FDwfGetLastError(DWFERC *pdwferc) Parameters: pdwferc - Variable to receive error code. The function above is used to retrieve the last error code in the calling process. The error code is cleared when other API functions are called and is only set when an API function fails during execution. Error codes are declared in dwf.h: API Error Codes Error Code Definition dwfercNoErc No error occurred. dwfercUnknownError Call waiting on pending API time out.
WaveForms™ SDK Reference Manual 3 Device Enumeration The FDwfEnum functions are used to discover all connected, compatible devices. See Device_Enumeration.py example. FDwfEnum(ENUMFILTER enumfilter, int *pnDevice) Parameters: enumfilter – Filter value to be used for device enumeration. Use the enumfilterAll constant to discover all compatible devices. pnDevice – Integer pointer to return count of found devices by reference.
WaveForms™ SDK Reference Manual FDwfEnumDeviceName(int idxDevice, char szDeviceName[32]) Parameters: - idxDevice – Index of the enumerated device. szDeviceName – Pointer to character array to return the device name by reference. The function above is used to retrieve the device name of the enumerated device. FDwfEnumSN(int idxDevice, char szSN[32]) Parameters: idxDevice – Index of the enumerated device. szSN – Pointer to character array to return the serial number by reference.
WaveForms™ SDK Reference Manual 4 Device Control FDwfDeviceOpen(int idxDevice, HDWF *phdwf) Parameters: idxDevice – Zero based index of the enumerated device. phdwf – Pointer to HDWF variable to receive opened interface handle by reference. The function above opens a device identified by the enumeration index and retrieves a handle. To automatically enumerate all connected devices and open the first discovered device, use index -1.
WaveForms™ SDK Reference Manual FDwfDeviceAutoConfigureSet(HDWF hdwf, BOOL fAutoConfigure) Parameters: hdwf – Interface handle. fAutoConfigure– Value for this option: TRUE if enabled, FALSE if disabled. The function above enables or disables the AutoConfig setting for a specific device. When this setting is enabled, the device is automatically configured every time an instrument parameter is set.
WaveForms™ SDK Reference Manual The global trigger bus allows multiple instruments to trigger each other. These trigger source options are: Trigger Source Options Trigger Source Function trigsrcNone The trigger pin is high impedance, input. This is the default setting. trigsrcPC Trigger from PC, this can be used to synchronously start multiple instruments. trigsrcDetectorAnalogIn Trigger detector on analog in channels. trigsrcDetectorDigitalIn Trigger on digital input channels.
WaveForms™ SDK Reference Manual Board ON Trig Ext Oscilloscope Analyzer Control Trigger Detector WaveGen 1 Control Trigger signals bus ADC Control DI/O Trigger Detector Patterns Control FDwfDeviceTriggerSet(HDWF hdwf, int idxPin, TRIGSRC trigsrc) Parameters: hdwf – Interface handle. idxPin – External trigger, I/O pin index. trigsrc – Trigger source to set. The function above is used to configure the trigger I/O pin with a specific TRIGSRC option.
WaveForms™ SDK Reference Manual 5 Analog In (Oscilloscope) The Analog In instrument states: Instrument configuration or setting Ready Reconfigure? Start? Configure Armed Start? Prefill Done Trigger? Running The states are defined in dwf.h DwfState type. - - Ready: Initial state. After FDwfAnalogInConfigure or any FDwfAnalogIn*Set function call goes to this state. With FDwfAnalogInConfigure, reconfigure goes to Configure state.
WaveForms™ SDK Reference Manual FDwfAnalogInConfigure(HDWF hdwf, BOOL fReconfigure, BOOL fStart) Parameters: hdwf – Interface handle. fReconfigure – Configure the device. fStart – Start the acquisition. The function above is used to configure the instrument and start or stop the acquisition. To reset the Auto trigger timeout, set fReconfigure to TRUE. FDwfAnalogInStatus(HDWF hdwf, BOOL fReadData, DwfState *psts) Parameters: hdwf – Interface handle. fReadData – TRUE if data should be read.
WaveForms™ SDK Reference Manual FDwfAnalogInStatusAutoTriggered(HDWF hdwf, BOOL *pfAuto) Parameters: hdwf – Interface handle. pfAuto – Returns TRUE if the acquisition was auto triggered. The function above is used to verify if the acquisition is auto triggered. FDwfAnalogInStatusData( HDWF hdwf, int idxChannel, double *rgdVoltData, int cdData) Parameters: hdwf – Interface handle. idxChannel – Channel index. rgdVoltData – Pointer to allocated buffer to copy the acquisition data.
WaveForms™ SDK Reference Manual FDwfAnalogInStatusRecord( HDWF hdwf, int *pcdDataAvailable, int *pcdDataLost, int *pcdDataCorrupt) Parameters: hdwf – Interface handle. pcdDataAvailable – Pointer to variable to receive the available number of samples. pcdDataLost – Pointer to variable to receive the lost samples after the last check. pcdDataCorrupt – Pointer to variable to receive the number of samples that could be corrupt. The function above is used to retrieve information about the recording process.
WaveForms™ SDK Reference Manual 5.2 Configuration FDwfAnalogInFrequencyInfo(HDWF hdwf, double *phzMin, double *phzMax) Parameters: hdwf – Interface handle. phzMin – Pointer to return the minimum allowed frequency. phzMax – Pointer to return the maximum allowed frequency. The function above is used to retrieve the minimum and maximum (ADC frequency) settable sample frequency. FDwfAnalogInFrequencySet(HDWF hdwf, double hzFrequency) Parameters: hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfAnalogInBufferSizeSet(HDWF hdwf, int nSize) Parameters: hdwf – Interface handle. nSize – Buffer size to set. The function above is used to adjust the AnalogIn instrument buffer size. FDwfAnalogInBufferSizeGet(HDWF hdwf, int *pnSize) Parameters: hdwf – Interface handle. pnSize – Variable to receive the current buffer size. The function above returns the used AnalogIn instrument buffer size.
WaveForms™ SDK Reference Manual ACQMODE Constants FUNC Constant Capabilities acqmodeSingle Perform a single buffer acquisition. This is the default setting. acqmodeScanShift Perform a continuous acquisition in FIFO style. The trigger setting is ignored. The last sample is at the end of buffer. The FDwfAnalogInStatusSamplesValid function is used to show the number of the acquired samples, which will grow until reaching the BufferSize. Then the waveform “picture” is shifted for every new sample.
WaveForms™ SDK Reference Manual 5.3 Channels The oscilloscope channel settings are identical across all channels. FDwfAnalogInChannelCount(HDWF hdwf, int *pcChannel) Parameters: hdwf – Interface handle. pcChannel – Variable to receive the number of channels. The function above is used to read the number of AnalogIn channels of the device. FDwfAnalogInChannelEnableSet(HDWF hdwf, int idxChannel, BOOL fEnable) Parameters: hdwf – Interface handle. idxChannel – Zero based index of channel to enable/disable.
WaveForms™ SDK Reference Manual FDwfAnalogInChannelFilterSet(HDWF hdwf, int idxChannel, FILTER filter) Parameters: hdwf – Interface handle. idxChannel – Channel index. filter – Acquisition sample filter to set. The function above is used to set the acquisition filter for each AnalogIn channel. With channel index -1, each enabled AnalogIn channel filter will be configured to use the same, new option.
WaveForms™ SDK Reference Manual FDwfAnalogInChannelRangeSet(HDWF hdwf, int idxChannel, double voltsRange) Parameters: hdwf – Interface handle. idxChannel – Channel index. voltsRange – Voltage range to set. The function above is used to configure the range for each channel. With channel index -1, each enabled Analog In channel range will be configured to the same, new value. FDwfAnalogInChannelRangeGet(HDWF hdwf, int idxChannel, double *pvoltsRange) Parameters: hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfAnalogInChannelOffsetGet(HDWF hdwf, int idxChannel, double *pvoltOffset) Parameters: hdwf – Interface handle. idxChannel – Channel index. pvoltsRange – Variable to receive the offset voltage obtained. The function above returns for each AnalogIn channel the real offset level. FDwfAnalogInChannelAttenuationSet( HDWF hdwf, int idxChannel, double xAttenuation) Parameters: hdwf – Interface handle. idxChannel – Channel index. voltsRange – Channel offset voltage to set.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerSourceInfo(HDWF hdwf, int *pfstrigsrc) Parameters: hdwf – Interface handle. pfstrigsrc – Variable to receive the supported trigger sources. The function above returns the supported trigger source options for the AnalogIn instrument. 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 TRIGSRC constants in dwf.h.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerPositionGet(HDWF hdwf, double *psecPosition) Parameters: hdwf – Interface handle. psecPosition – Variable to receive the current trigger position. The function above returns the configured trigger position in seconds. FDwfAnalogInTriggerAutoTimeoutInfo( HDWF hdwf, double *psecMin, double *psecMax, int *pnSteps) Parameters: hdwf – Interface handle. psecMin – Variable to receive the minimum timeout. psecMax – Variable to receive the maximum timeout.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerHoldOffInfo( HDWF hdwf, double *psecMin, double *psecMax, double *pnStep) Parameters: hdwf – Interface handle. psecMin – Variable to receive the minimum hold off value. psecMax – Variable to receive the maximum hold off value. The function above returns the supported range of the trigger Hold-Off time in Seconds. The trigger hold-off is an adjustable period of time during which the acquisition will not trigger.
WaveForms™ SDK Reference Manual trigtypeEdge: trigger on rising or falling edge. This is the default setting. trigtypePulse: trigger on positive or negative; less, timeout, or more pulse lengths. trigtypeTransition: trigger on rising or falling; less, timeout, or more transition times. FDwfAnalogInTriggerTypeSet(HDWF hdwf, TRIGTYPE trigtype) Parameters: hdwf – Interface handle. trigtype – Trigger type to set. The function above is used to set the trigger type for the instrument.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerChannelGet(HDWF hdwf, int *pidxChannel) Parameters: hdwf – Interface handle. pidxChannel – Variable to receive the current trigger channel index. The function above is used to retrieve the current trigger channel index. FDwfAnalogInTriggerFilterInfo(HDWF hdwf, int *pfsfilter) Parameters: hdwf – Interface handle. pfsFilter – Variable to receive the supported trigger filters. The function above returns the supported trigger filters.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerConditionInfo(HDWF hdwf, int *pfstrigcond) Parameters: hdwf – Interface handle. pfstrigcond – Variable to receive the supported trigger conditions. The function above returns the supported trigger type options for the instrument. 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 TRIGCOND constants in dwf.h.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerLevelSet(HDWF hdwf, double voltsLevel) Parameters: hdwf – Interface handle. voltsLevel – Trigger voltage level to set. The function above is used to set the trigger voltage level in Volts. FDwfAnalogInTriggerLevelGet(HDWF hdwf, double *pvoltsLevel) Parameters: hdwf – Interface handle. pvoltsLevel – Variable to receive the current trigger voltage level. The function above is used to get the current trigger voltage level in Volts.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerLengthConditionInfo(HDWF hdwf, int *pfstriglen) Parameters: hdwf – Interface handle. pfsstriglen – Variable to receive the supported trigger length conditions. The function above returns the supported trigger length condition options for the AnalogIn instrument. 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 TRIGLEN constants in DWF.h.
WaveForms™ SDK Reference Manual FDwfAnalogInTriggerLengthSet(HDWF hdwf, double secLength) Parameters: hdwf – Interface handle. secLength – Trigger length to set. The function above is used to set the trigger length in Seconds. FDwfAnalogInTriggerLengthGet(HDWF hdwf, double *psecLength) Parameters: hdwf – Interface handle. secLength – Variable to receive the current trigger length. The function above is used to get the current trigger length in Seconds. Copyright Digilent, Inc. All rights reserved.
WaveForms™ SDK Reference Manual 6 Analog Out (Arbitrary Waveform Generator) The Analog Out instrument states: Instrument configuration or setting Ready Start? Armed Trigger? Repeat Done Wait Running The states are defined in dwf.h DwfState type. Ready: Initial state. After FDwfAnalogOutConfigure or any FDwfAnalogOut*Set function call goes to this state. With digital out, configure start command goes to Armed state. Armed: It waits for trigger.
WaveForms™ SDK Reference Manual Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
WaveForms™ SDK Reference Manual 6.1 Control FDwfAnalogOutReset(HDWF hdwf, int idxChannel) Parameters: hdwf – Interface handle. idxChannel – Channel index. The function above resets and configures (by default, having auto configure enabled) all AnalogOut instrument parameters to default values for the specified channel. To reset instrument parameters across all channels, set idxChannel to -1. FDwfAnalogOutConfigure(HDWF hdwf, int idxChannel, BOOL fStart) Parameters: hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodePlayData( HDWF hdwf, int idxChannel, AnalogOutNode node, double *rgdData, int cdData) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. rgdData – Pointer to samples array to be sent to the device. cdData – Number of samples to send. The function above is used to sending new data samples for play mode.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodeEnableSet( HDWF hdwf, int idxChannel, AnalogOutNode node, BOOL fEnable) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. fEnable – TRUE to enable, FALSE to disable. The function above enables or disables the channel node specified by idxChannel and node. The Carrier node enables or disables the channel and AM/FM the modulation.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodeFunctionInfo( HDWF hdwf, int idxChannel, AnalogOutNode node, int *pfsfunc) Parameters: - hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. pfsfunc – Variable to receive the supported generator function options. The function above returns the supported generator function options. They are returned (by reference) as a bit field. This bit field can be parsed using the IsBitSet Macro.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodeFunctionGet( HDWF hdwf, int idxChannel, AnalogOutNode node, FUNC *pfunc) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. ptrigsrc – Pointer to variable to receive the generator function option. The function above is used to retrieve the current generator function option for the specified instrument channel.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodeAmplitudeInfo( HDWF hdwf, int idxChannel, AnalogOutNode node, double *pvMin, double *pvMax) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. pvMin – Minimum amplitude level or modulation index. pvMax – Maximal amplitude level or modulation index. The function above is used to retrieve the amplitude range for the specified channel-node on the instrument.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodeOffsetInfo( HDWF hdwf, int idxChannel, AnalogOutNode node, double *pvMin, double *pvMax) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. pvMin – Minimum offset voltage or modulation offset percentage. pvMax – Maximum offset voltage or modulation offset percentage. The function above is used to retrieve available the offset range. For carrier node in units of volts, and in percentage units for AM/FM nodes.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodeSymmetrySet(HDWF hdwf, int idxChannel, AnalogOutNode node, AnalogOutNode node, double percentageSymmetry) Parameters: - hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. 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.
WaveForms™ SDK Reference Manual FDwfAnalogOutNodePhaseGet(HDWF hdwf, int idxChannel, AnalogOutNode node, double *pdegreePhase) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. node – Node index. pdegreePhase – Pointer to variable to receive Phase value (in degrees). The function above is used to get the current phase for the specified channel-node on the instrument.
WaveForms™ SDK Reference Manual FDwfAnalogOutLimitationInfo( HDWF hdwf, int idxChannel, double *pvMin, double *pvMax) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. pvMin – Minimum limitation value. pvMax – Maximum offset voltage or modulation offset percentage. The function above is used to retrieve available the limitation range.
WaveForms™ SDK Reference Manual FDwfAnalogOutModeGet(HDWF hdwf, int idxChannel, DwfAnalogOutMode *pmode) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. mode – Pointer to variable to receive the generator mode option. The function above is used to retrieve the current generator mode option for the specified instrument channel. FDwfAnalogOutIdleInfo(HDWF hdwf, int idxChannel, int *pfsidle) Parameters: - hdwf – Open interface handle on a device. idxChannel – Channel index.
WaveForms™ SDK Reference Manual 6.3 States FDwfAnalogOutTriggerSourceInfo(HDWF hdwf, int idxChannel, int *pfstrigsrc) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. pfstrigsrc – Variable to receive the supported trigger sources. The function above returns the supported trigger source options for the instrument. See the description of FDwfDeviceTriggerInfo.
WaveForms™ SDK Reference Manual FDwfAnalogOutRunSet(HDWF hdwf, int idxChannel, double secRun) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. secRun – Run length to set expressed in seconds. The function above is used to set the run length for the instrument in Seconds. FDwfAnalogOutRunGet(HDWF hdwf, int idxChannel, double *psecRun) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. psecRun – Pointer to variable to receive the run length.
WaveForms™ SDK Reference Manual FDwfAnalogOutWaitGet(HDWF hdwf, int idxChannel, double *psecWait) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. psecWait – Pointer to variable to receive the wait length. The function above is used to get the current wait length for the channel on instrument. FDwfAnalogOutRepeatInfo(HDWF hdwf, int idxChannel, int *pnMin, int *pnMax) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index.
WaveForms™ SDK Reference Manual FDwfAnalogOutRepeatTriggerSet(HDWF hdwf, int idxChannel, BOOL fRepeatTrigger) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. fRepeatTrigger – Boolean used to specify if the trigger should be included in a repeat cycle. The function above is used to set the repeat trigger option. To include the trigger in wait-run repeat cycles, set fRepeatTrigger to TRUE. It is disabled by default.
WaveForms™ SDK Reference Manual 7 Analog I/O The AnalogIO functions are used to control the power supplies, reference voltage supplies, voltmeters, ammeters, thermometers, and any other sensors on the device. These are organized into channels which contain a number of nodes. For instance, a power supply channel might have three nodes: an enable setting, a voltage level setting/reading, and current limitation setting/reading. See the AnalogIO.py example.
WaveForms™ SDK Reference Manual FDwfAnalogIOEnableSet(HDWF hdwf, BOOL fMasterEnable) Parameters: hdwf – Open interface handle on a device. fMasterEnable – Set TRUE to enable the master switch; FALSE to disable the master switch. The function above is used to set the master enable switch. FDwfAnalogIOEnableGet(HDWF hdwf, BOOL *pfMasterEnable) Parameters: hdwf – Open interface handle on a device. pfMasterEnable – Pointer to variable to return the enabled configuration.
WaveForms™ SDK Reference Manual FDwfAnalogIOChannelInfo(HDWF hdwf, int idxChannel, int *pnNodes) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. pnNodes – Pointer to variable to return the number of node . The function above returns the number of nodes associated with the specified channel. FDwfAnalogIOChannelNodeName( HDWF hdwf, int idxChannel, char szNodeName[32], char szUnits[16]) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index.
WaveForms™ SDK Reference Manual FDwfAnalogIOChannelNodeSetInfo(HDWF hdwf, int idxChannel, int idxNode, double *pmin, double *pmax, int *pnSteps) Parameters: hdwf – Open interface handle on a device. idxChannel – Analog I/O channel index of the device. idxNode – Node index. pmin – Minimum settable value. pmax – Maximum settable value. pnSteps – Number of steps between minimum and maximum values. These functions return node value limits.
WaveForms™ SDK Reference Manual FDwfAnalogIOChannelNodeStatusInfo( HDWF hdwf, int idxChannel, int idxNode, double *pmin, double *pmax, int *pnSteps) Parameters: hdwf – Interface handle. idxChannel –Channel index . idxNode – Node index. pmin – Minimum reading value. pmax – Maximum reading value. pnSteps – Number of steps between minimum and maximum values. The function above returns node the range of reading values available for the specified node on the specified channel.
WaveForms™ SDK Reference Manual FDwfDigitalIOStatus(HDWF hdwf) Parameters: hdwf – Open interface handle on a device. The function above reads the status and input values, of the device DigitalIO to the PC. The status and values are accessed from the FDwfDigitalIOInputStatus function. FDwfDigitalIOOutputEnableInfo(HDWF hdwf, unsigned int *pfsOutputEnableMask) Parameters: hdwf – Open interface handle on a device. pfsOutputEnableMask – Variable to return the OE mask bit field.
WaveForms™ SDK Reference Manual FDwfDigitalIOOutputSet(HDWF hdwf, unsigned int fsOutput) Parameters: hdwf – Open interface handle on a device. fsOutput – Output bit set. The function above is used to set the output logic value on all output pins. FDwfDigitalIOOutputGet(HDWF hdwf, unsigned int *pfsOutput) Parameters: hdwf – Open interface handle on a device. pfsOutput – Pointer to variable to returns output bit set. The function above returns the currently set output values across all output pins.
WaveForms™ SDK Reference Manual 9 Digital In (Logic Analyzer) The Digital In instrument states: Instrument configuration or setting Ready Reconfigure? Start? Configure Armed Start? Prefill Done Trigger? Running The states are defined in dwf.h DwfState type. Ready: Initial state. After FDwfDigitalInConfigure or any FDwfDigitalIn*Set function call goes to this state. With FDwfDigitalInConfigure, reconfigure goes to Configure state. Configure: The digital in auto trigger is reset.
WaveForms™ SDK Reference Manual 9.1 Control FDwfDigitalInReset(HDWF hdwf) Parameters: hdwf – Interface handle. The function above resets and configures (by default, having auto configure enabled) all DigitalIn instrument parameters to default values. FDwfDigitalInConfigure(HDWF hdwf, BOOL fReconfigure, BOOL fStart) Parameters: hdwf – Interface handle. fReconfigure – Configure the device. fStart – Start the acquisition.
WaveForms™ SDK Reference Manual FDwfDigitalInStatusIndexWrite(HDWF hdwf, int *pidxWrite) Parameters: - hdwf – Interface handle. - pidxWrite – Variable to receive the position of the acquisition. The function above is used to retrieve the buffer write pointer. This is needed in ScanScreen acquisition mode to display the scan bar. FDwfDigitalInStatusAutoTriggered(HDWF hdwf, BOOL *pfAuto) Parameters: - hdwf – Interface handle. - pfAuto – Returns TRUE if the acquisition was auto triggered.
WaveForms™ SDK Reference Manual 9.2 Configuration FDwfDigitalInInternalClockInfo(HDWF hdwf, double *phzFreq) Parameters: - hdwf – Interface handle. - phzFreq – Pointer to return the internal clock frequency. The function above is used to retrieve the internal clock frequency. FDwfDigitalInClockSourceInfo(HDWF hdwf, int *pfsDwfDigitalInClockSource) Parameters: hdwf – Open interface handle on a device. pfsDwfDigitalInClockSource – Pointer to variable to return the available clock source options.
WaveForms™ SDK Reference Manual FDwfDigitalInDividerSet(HDWF hdwf, unsigned int div) Parameters: hdwf – Interface handle. div – Divider value. The function above is used to set the clock divider value. FDwfDigitalInDividerGet(HDWF hdwf, unsigned int *pdiv) Parameters: hdwf – Interface handle. pdiv –Pointer to return configured value. The function above is used to get the configured clock divider value. FDwfDigitalInBitsInfo(HDWF hdwf, int *pnBits) Parameters: hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfDigitalInBufferSizeInfo(HDWF hdwf, int *pnSizeMax) Parameters: hdwf – Interface handle. pnSizeMax – Pointer to variable to return maximum buffer size. The function above returns the Digital In maximum buffer size. FDwfDigitalInBufferSizeSet(HDWF hdwf, int nSize) Parameters: hdwf – Interface handle. nSize – Buffer size. The function above is used to set the buffer size. FDwfDigitalInBufferSizeGet(HDWF hdwf, int *pnSize) Parameters: hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfDigitalInSampleModeGet(HDWF hdwf, DwfDigitalInSampleMode *pv) Parameters: hdwf – Open interface handle on a device. pv – Pointer to return configured value. The function above is used to return the configured sample mode. FDwfDigitalInAcquisitionModeInfo(HDWF hdwf, int *pfsacqmode) Parameters: hdwf – Interface handle. pfsacqmode – Pointer to return the supported acquisition modes. The function above returns the supported DigitalIn acquisition modes.
WaveForms™ SDK Reference Manual 9.3 Trigger FDwfDigitalInTriggerSourceInfo(HDWF hdwf, int *pfstrigsrc) Parameters: - hdwf – Interface handle. - pfstrigsrc – Variable to receive the supported trigger sources. The function above returns the supported trigger source options for the instrument. See the description of FDwfDeviceTriggerInfo. FDwfDigitalInTriggerSourceSet(HDWF hdwf, TRIGSRC trigsrc) Parameters: - hdwf – Interface handle. - trigsrc – Trigger source to set.
WaveForms™ SDK Reference Manual FDwfDigitalInTriggerPositionGet( HDWF hdwf, unsigned int *pcSamplesAfterTrigger) Parameters: - hdwf – Interface handle. - pcSamplesAfterTrigger – Pointer to variable to receive configured value The function above is used to get the configured trigger position. FDwfDigitalInTriggerAutoTimeoutInfo( HDWF hdwf, double *psecMin, double *psecMax, double *pnSteps) Parameters: hdwf – Interface handle. psecMin – Variable to receive the minimum timeout.
WaveForms™ SDK Reference Manual 9.4 Trigger Detector In order to use trigger on digital in pins, set trigger source with FDwfDigitalInTriggerSourceSet to trigsrcDetectorDigitalIn. FDwfDigitalInTriggerInfo(HDWF hdwf, unsigned int *pfsLevelLow, unsigned int *pfsLevelHigh, unsigned int *pfsEdgeRise, unsigned int *pfsEdgeFall) Parameters: hdwf – Interface handle. pfsLevelLow – Variable to receive the supported low state triggers. pfsLevelHigh – Variable to receive the supported low state triggers.
WaveForms™ SDK Reference Manual 10 Digital Out (Pattern Generator) The DigitalOut instrument states: Instrument configuration or setting Ready Start? Done Armed Repeat Trigger? Wait Running The states are described defined in dwf.h DwfState type. Ready: Initial state. After FDwfDigitalOutConfigure or any FDwfDigitalOut*Set function call goes to this state. With digital out, configure start command goes to Armed state Armed: It waits for trigger.
WaveForms™ SDK Reference Manual Channel configuration: Initial Low High Initial Divider Clock Divider Expire Pulse (Level) Counter (TS +2) Expire Address PP OS OD TS(2) Idle OE IO Running? Mode Custom 1/2 Type Random 1 1/2 OE IO The initial values, for divider and counter, specify the initially loaded values, initial delay, when entering in Running state. The Divider specifies the clock division. This rate will be the custom sample frequency and step for the counter.
WaveForms™ SDK Reference Manual Pulse signal: Triggered/Running state Divider Initial Divide Divide Divide ... Each expire of divider is one step for the counter Counter start high Initial Low High Low ... High Low High ... Counter start low Initial For pulse signal the initial level and initial value are specified with FDwfDigitalOutCounterInitSet function. These are loaded when entering Running state. 10.1 Control FDwfDigitalOutReset(HDWF hdwf) Parameters: - hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfDigitalOutStatus(HDWF hdwf, DwfState *psts) Parameters: - hdwf – Interface handle. - psts – Pointer to variable to return the state. The function above is used to check the state of the instrument. 10.2 Configuration FDwfDigitalOutInternalClockInfo(HDWF hdwf, double *phzFreq) Parameters: - hdwf – Interface handle. - phzFreq – Pointer to return the internal clock frequency. The function above is used to retrieve the internal clock frequency.
WaveForms™ SDK Reference Manual FDwfDigitalOutRunInfo(HDWF hdwf, double *psecMin, double *psecMax) Parameters: - hdwf – Interface handle. - psecMin – Variable to receive the supported minimum run length. - psecMax – Variable to receive the supported maximum run length. The function above is used to return the supported run length range for the instrument in seconds. Zero value (default) represent an infinite (or continuous) run.
WaveForms™ SDK Reference Manual FDwfDigitalOutWaitSet(HDWF hdwf, double secWait) Parameters: - hdwf – Interface handle. - secWait – Wait length to set expressed in seconds. The function above is used to set the wait length. FDwfDigitalOutWaitGet(HDWF hdwf, double *psecWait) Parameters: - hdwf – Interface handle. - psecWait – Pointer to variable to receive the wait length. The function above is used to get the current wait length.
WaveForms™ SDK Reference Manual FDwfDigitalOutRepeatStatus(HDWF hdwf, unsigned int *pcRepeat) Parameters: - hdwf – Interface handle. - pcRepeat – Pointer to variable to receive the remaining repeat counts. The function above is used to read the remaining repeat counts. It only returns information from the last FDwfDigitalOutStatus function call, it does not read from the device. FDwfDigitalOutRepeatTriggerSet(HDWF hdwf, BOOL fRepeatTrigger) Parameters: - hdwf – Interface handle.
WaveForms™ SDK Reference Manual FDwfDigitalOutEnableGet(HDWF hdwf, int idxChannel, BOOL *pfEnable) Parameters: - hdwf – Interface handle. - idxChannel – Channel index. - pfEnable – Pointer to variable to receive enabled state. The function above is used to verify if a specific channel is enabled or disabled. FDwfDigitalOutOutputInfo( HDWF hdwf, int idxChannel, int *pfsDwfDigitalOutOutput) Parameters: - hdwf – Interface handle. - idxChannel – Channel index.
WaveForms™ SDK Reference Manual 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.
WaveForms™ SDK Reference Manual 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.
WaveForms™ SDK Reference Manual 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.
WaveForms™ SDK Reference Manual 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.
WaveForms™ SDK Reference Manual 11 Deprecated functions The following functions are replaced by FDwfAnalogOutNode *providing access to the Amplitude and Frequency Modulation of Analog Out channels. FDwfAnalogOutPlayStatus(HDWF hdwf, int idxChannel, int *cdDataFree, int *cdDataLost, int *cdDataCorrupted) Parameters: - hdwf – Open interface handle on a device. idxChannel – Channel index. cdDataFree – Pointer to variable to return the available free buffer space, the number of new samples that can be sent.
WaveForms™ SDK Reference Manual FDwfAnalogOutEnableGet(HDWF hdwf, int idxChannel, BOOL *pfEnable) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. pfEnable – Pointer to variable to receive enabled state. The function above is used to verify if a specific channel is enabled or disabled. FDwfAnalogOutFunctionInfo(HDWF hdwf, int idxChannel, int *pfsfunc) Parameters: - hdwf – Open interface handle on a device. idxChannel – Channel index.
WaveForms™ SDK Reference Manual FDwfAnalogOutFrequencyInfo( HDWF hdwf, int idxChannel, double *phzMin, double *phzMax) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. phzMin – Variable to receive the supported minimum frequency. phzMax – Variable to receive the supported maximum frequency. The function above is used to return the supported frequency range for the instrument. The maximum value shows the DAC frequency.
WaveForms™ SDK Reference Manual FDwfAnalogOutAmplitudeSet(HDWF hdwf, int idxChannel, double vAmplitude) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. vAmplitude – Amplitude of channel in Volts or modulation index in percentage. The function above is used to set the amplitude or modulation index for the specified channel on the instrument. With channel index -1, each enabled Analog Out channel amplitude will be configured to use the same, new option.
WaveForms™ SDK Reference Manual FDwfAnalogOutSymmetryInfo( HDWF hdwf, int idxChannel, double *ppercentageMin, double *ppercentageMax) Parameters: - hdwf – Open interface handle on a device. idxChannel – Channel index. ppercentageMin – Minimum value of Symmetry percentage. ppercentageMax – Maximum value of Symmetry percentage. The function above is used to obtain the symmetry (or duty cycle) range (0..100). This symmetry is supported for standard signal types.
WaveForms™ SDK Reference Manual FDwfAnalogOutPhaseSet( HDWF hdwf, int idxChannel, double degreePhase) Parameters: hdwf – Open interface handle on a device. idxChannel – Channel index. degreePhase – Value of Phase in degrees. The function above is used to set the phase for the specified channel on the instrument. With channel index -1, each enabled Analog Out channel phase will be configured to use the same, new option.