Table of Contents

Advertisement

Quick Links

Programmer's Manual
for:
TP112
TP208
TP508
TP801 AWG ISA
TP801 AWG PCI
TE6100
Revision 1.26
TiePie DLLs
TiePieSCOPE HS508
TiePieSCOPE HS801 AWG
Handyprobe HP2
Handyscope HS2
Handyscope HS3
Handyscope HS4 (DIFF)

Advertisement

Table of Contents
loading

Summary of Contents for TiePie TP112

  • Page 1 Programmer's Manual TiePie DLLs for: TP112 TiePieSCOPE HS508 TP208 TiePieSCOPE HS801 AWG TP508 Handyprobe HP2 TP801 AWG ISA Handyscope HS2 TP801 AWG PCI Handyscope HS3 TE6100 Handyscope HS4 (DIFF) Revision 1.26...
  • Page 3: Table Of Contents

    Table of contents Table of contents ..........3 Introduction .
  • Page 4 Getting the current transfer mode ....24 Performing streaming measurements ....25 Control the input resolution .
  • Page 5 Control the digital outputs ....... . 44 Set the digital outputs ......44 Get the current status of the digital outputs .
  • Page 6 Retrieve the measured data in Volts ....63 Get the current sampling frequency ....63 Set the sampling frequency .
  • Page 7: Introduction

    Introduction This manual describes the available functions in the DLLs for the various TiePie measuring instruments. engineering For each instrument, a specific DLL is available. All DLLs have the same routines and the same programming interface. Since all instruments have different specifications, a number of functions are available to determine the specifications of the instrument, like e.g.
  • Page 8 Introduction...
  • Page 9: How Can I

    How can I... Understand the codes Error codes Most routines in the DLL return a status value, that indicates whether the routi- ne was executed successfully or not. In case of a non successfull execution, the returb value will indicate the possible cause of the error. The following codes are used: Code Names Code Values...
  • Page 10 lCh1 = 1 lCh2 = 2 lCh3 = 3 lCh4 = 4 The routines that deal with the MeasureMode use different values: mmCh1 = 1 mmCh2 = 2 mmCh3 = 4 mmCh4 = 8 How can I...
  • Page 11: Open / Close The Instrument

    Open / Close the instrument Search and Initialize the Instrument word InitInstrument( word wAddress ) Descriptions: Initialize the hardware of the instrument. Set default measure- ment settings, allocate memory and obtain the calibration con- stants etc. Parallel port connected instruments, USB instruments and PCI bus instruments detect the hardware by themselves and ignore the address parameters.
  • Page 12: Get Information About My Instrument

    Get the instrument serial number word GetSerialNumber( dword *dwSerialNumber ) Description: This routine returns the Serial Number of the instrument. This number is hard coded in the hardware. TP112, TP208 and TP508 do not have a serial number in the instrument. Input: Output:...
  • Page 13: Determine The Available Input Sensitivities

    Determine the available input sensitivities word GetAvailableSensitivities( double *dSensitivities ) This routine retrieves the available input sensitivities from the description: hardware and stores them in an array. dSensitivities is a 20 elements large array. The caller must ensure that there is enough space in the array to contain the data. There- fore the size of the array in bytes must be at least 20 * sizeof(double) At return, all elements containing a non-zero value, contain an...
  • Page 14: Get The Number Of Input Channels

    Get the number of input channels word GetNrChannels( word *wNrChannels ) This routine returns the number of input channels of the instru- Description: ment. Input: Output: the number of channels wNrChannels E_NO_ERRORS Return value E_NO_HARDWARE Get the maximum sampling frequency double GetMaxSampleFrequencyF( void ) Description: The different instruments have different maximum sampling fre-...
  • Page 15: Check For Availability Of Dc Hardware Offset Adjustment

    Check for availability of DC hardware offset adjustment word GetDCLevelStatus( void ) Some instruments support DC Hardware offset adjustment. This Description: routine checks if the DC Level is supported. Input: Output: E_NO_ERRORS Return value E_NOT_SUPPORTED E_NO_HARDWARE Check for a square wave generator word GetSquareWaveGenStatus( void ) Some instruments have a built-in square wave generator, the Description:...
  • Page 16: Get The Maximum Amplitude Of The Function Generator

    Get the maximum amplitude of the function generator word GetFuncGenMaxAmplitude( double *dAmplitude ) The maximum output voltage for the TiePieSCOPE HS801 and Description: Handyscope HS3 generator is 12 Volt, the maximum output voltage for the TP801 generator is 10 Volt. This routine determi- nes the maximum voltage.
  • Page 17: Perform A Measurement

    Perform a measurement Start a measurement word ADC_Start( void ) Description: This routine writes any new instrument setting information to the hardware and then starts the measurement. If the hardware is already measuring, this measurement is aborted. Previous mea- sured data is lost Input: Output: E_NOT_INITIALIZED...
  • Page 18: Read The Trigger Status

    Read the trigger status word ADC_Triggered( void ) This routine reads the trigger status from the hardware. The Description: returned value indicates which trigger source caused the trigger, this value is different for various instruments. Input: Output: HS4 / HS4 DIFF other instruments Return value not triggered...
  • Page 19: Retrieve The Data

    Retrieve the data Get the data from a specific channel in binary format word ADC_GetDataCh( word wCh, word *wData ) Description: This routine transfers the measured data of one channel from the acquisition memory in the hardware via the DLL into the memo- ry in the application.
  • Page 20: Get All Digital Input Values

    Get all digital input values word GetDigitalInputValues( word *wValues ) The TP112 has eight digital inputs, which are sampled simultane- Description: ously with the analog input channels. This routine transfers the measured digital values from the me- mory in the DLL into the memory in the application. The measu- red data is returned in binary values.
  • Page 21: Example Of Use Of The Routines

    Example of use of the routines To use the measurement routines, your application could contain a loop like the following (for a two channel instrument): type TDoubleArray = array[0 .. 128 * 1024 - 1] of double; var wCh : word; wChCount : word;...
  • Page 22 ADC_Start; StartTime := GetCurrentTime; while bContinue do begin GetCurrentTime > ( StartTime + TimeOut ) then begin ADC_ForceTrig; end; { if } if ADC_Ready = then begin for wCh := lCh1 to wChCount do begin ADC_GetDataChVolt( wCh, ChDoubleArray[wCh] ); end; { for } ADC_Start;...
  • Page 23: Setup For Streaming Measurements

    Setup for streaming measurements It is possible to do streaming measurements with the Handyscope HS3 and Handyscope HS4 (DIFF). Each time a specified number of samples is measured (the record length), they can be transferred to the computer and processed while the hardware continues measuring uninterrupted.
  • Page 24: Setting Up Streaming Measurements

    Setting up streaming measurements To tell the instrument a streaming measurement has to be performed, following routine has to be used. word SetTransferMode( dword dwMode ) Description: This routine tells the instrument what kind of measurement has to be performed. determines the requested data transfer mode.
  • Page 25: Performing Streaming Measurements

    Performing streaming measurements When the callback function has been created and the transfer mode is set to streaming mode, streaming measurements can be performed. The sampling speed has to be set to the required values and the input channels have to be set to appropriate values (auto ranging does not work in streaming mode).
  • Page 26: Control The Input Resolution

    Control the input resolution The Handyscope HS3 and Handyscope HS4 (DIFF) support a number of diffe- rent input resolutions. Set the input resolution word SetResolution( byte byResolution ) This routine sets the input resolution of the hardware. Description: Use GetAvailableResolutions() to determine which resolutions are available.
  • Page 27: Control The Instrument Configuration

    Control the instrument configuration The Handyscope HS3 allows to change it’s instrument configuration. It supports the following configurations: (0) operate as a 2 channel 12 bit instrument with 128K licHS3Norm samples per channel and an Arbitrary Waveform Genera- tor. (1) operate as a 2 channel 12 bit instrument with 256K licHS3256K samples per channel, without generator.
  • Page 28: Control Which Channels Are Measured

    Control which channels are measured The routines to get or set the measure mode use channel numbers. The follo- wing numbers are used: mmCh1 = 1 mmCh2 = 2 mmCh3 = 4 mmCh4 = 8 Get the current measure mode word GetMeasureMode( byte *byMode ) Description: This routine returns the current Measure Mode:...
  • Page 29: Control The Time Base

    Control the time base Get the current record length dword GetRecordLength( void ) Description: This routine returns the total number of points to be digitized. The number of pre samples (number of samples to measure the trigger occurred) is calculated like this: before PreSamples = RecordLength - PostSamples.
  • Page 30: Get The Current Number Of Post Samples

    Get the current number of post samples dword GetPostSamples( void ) This routine returns the number of post samples to measure (the Description: number of samples the trigger has occurred). after Input: Output: The current selected number of post samples to Return value measure.
  • Page 31: Get The Current Sampling Frequency

    Get the current sampling frequency double GetSampleFrequencyF( void ) This routine returns the current set sampling frequency in Hz. Description: The minimum/maximum frequency supported is instrument dependent. Input: Output: The current sampling frequency in Hz. Return value Set the sampling frequency word SetSampleFrequencyF( double *dFreq ) Remarks: The routine sets the sampling frequency.
  • Page 32: Get The Sample Clock Status

    Get the sample clock status word GetExternalClock( word *wMode ) This routine determines whether the sampling clock uses the Description: internal Crystal oscillator or the external clock input Only 50 MHz and faster devices support external clock input Input: Output: The status of the internal clock, wMode 0 = clock internal...
  • Page 33: Control The Analog Input Channels

    Control the analog input channels The routines to adjust channel settings use channel numbers. The following numbers are used: lCh1 = 1 lCh2 = 2 lCh3 = 3 lCh4 = 4 etc. Get the current input sensitivity word GetSensitivity( byte byCh, double *dSens ) Description: This routine returns the current selected full scale input sensitivity in Volts for the selected channel.
  • Page 34: Get The Current Auto Ranging Status

    Get the current auto ranging status word GetAutoRanging( byte byCh, byte *byMode ) This routine returns the current auto ranging mode: Description: Auto ranging is off Auto ranging is on. If Auto ranging is switched on for a channel, the sensitivity will be automatically adjusted if the input signal becomes too large or too small.
  • Page 35: Get The Current Input Coupling

    Get the current input coupling word GetCoupling( byte byCh, byte *byMode ) This routine returns the current signal coupling for the selected Description: channel: lctAC : coupling AC (0) lctDC :coupling DC (1) In DC mode both the DC and the AC components of the signal are measured.
  • Page 36: Get The Current Dc Level Value

    Get the current DC level value word GetDcLevel( byte byCh, double *dLevel ) This routine returns the current DC Level value for the selected Description: channel. This voltage is added to the input signal before digitizing. This is used to shift a signal that is outside the current input range into the input range.
  • Page 37: Control The Trigger System

    Control the trigger system Get the current trigger source word GetTriggerSource( byte *bySource ) Description: This routine is used to retrieve the current Trigger Source of the acquisition system. ltsCh1 ( 0) Channel 1 ltsCh2 ( 1) Channel 2 ltsCh3 ( 2) Channel 3 ltsCh4 ( 3) Channel 4...
  • Page 38: Get The Current Trigger Mode

    Get the current trigger mode word GetTriggerMode( byte *byMode ) This routine is used to query the current Trigger Mode. Description: ltmRising (0) trigger on rising slope ltmFalling (1) trigger on falling slope ltmInWindow (2) trigger when signal gets inside window ltmOutWindow (3) trigger when signal gets outside window ltmTVLine (4) trigger on TV line sync pulse...
  • Page 39: Get The Current Trigger Mode For A Specific Channel

    Get the current trigger mode for a specific channel word GetTriggerModeCh( byte byCh, byte *byMode ) This routine is used to get the current Trigger Mode for a specific Description: channel. Some trigger modes are not available on all instruments, in that case, the value E_NOT_SUPPORTED will be returned.
  • Page 40: Get The Current Trigger Level

    Get the current trigger level word GetTriggerLevel( byte byCh, double *dLevel ) This routine is used to retrieve the Trigger Level of the selected Description: channel. The hardware starts to measure when the signal passes this level. The routine can be used to select the SetTriggerMode trigger slope.
  • Page 41: Get The Current Trigger Hysteresis

    Get the current trigger hysteresis word GetTriggerHys( byte byCh, double *dHysteresis ) This routine is used to retrieve the current Trigger Hysteresis. Description: The hysteresis is the minimum voltage change that is required to comply with the trigger conditions. This is used to minimize the influence of the noise on a signal on the trigger system.
  • Page 42: Select The Pxi External Trigger Signals

    The TE6100 has 8 digital external trigger inputs, at the PXI bus, which can be used to trigger the measurement. It is possible to select which inputs have to be used and if the inputs have to respond to a rising or a falling slope. Select the PXI external trigger signals word SetPXITriggerEnables( byte byEnables ) Description:...
  • Page 43: Set The Pxi External Trigger Slopes

    Set the PXI external trigger slopes word SetPXITriggerSlopes( byte bySlopes ) This routine determines for each PXI external trigger input indivi- Description: dually whether it should respond to a falling or a rising slope. Input: a bit pattern that defines how the slope settings bySlopes for each input is set.
  • Page 44: Control The Digital Outputs

    Control the digital outputs Set the digital outputs word SetDigitalOutputs( byte byValue ) Description: The TP112 is equipped with 8 digital outputs, which can be set individually. This routine sets the status of the digital outputs. Input: the new status of the outputs. Each bit repre- byValue sents an output.
  • Page 45: Control The Square Wave Generator

    Control the Square Wave generator Get the current square wave generator frequency double GetSquareWaveGenFrequency( void ) Description: Some instruments have a built-in square wave generator, the HS508 for example. This routine returns the generator frequency in Hz. Input: Output: The generator frequency in Hz. Return value Remarks: Not all instruments have a square wave generator, use the routi-...
  • Page 46: Control The Arbitrary Waveform Generator

    Control the Arbitrary Waveform Generator The Arbitrary Waveform Generator can operate in two different modes, DDS mode and Linear mode. In DDS mode, the generator frequency refers to the frequency of the signal that is generated. In linear mode, the generator frequency refers to the internal sampling clock of the generator.
  • Page 47: Set The Generator Signal Type

    Set the generator signal type word SetFuncGenSignalType( word wSignalType ) This routine sets the signal type of the function generator. Description: The requested signal type Input: wSignalType lstSine Sine wave lstTriangle (1) Triangular wave lstSquare Square wave lstDC lstNoise Noise lstArbitrary (5) Arbitrary signal Output:...
  • Page 48: Set The Generator Amplitude

    Set the generator amplitude word SetFuncGenAmplitude( double dAmplitude ) This routine sets the output amplitude of the function generator Description: in volts. When the requested amplitude is smaller than zero or larger than the maximum supported amplitude, E_INVALID_VA- LUE is returned and the requested value is ignored. Input: the function generator amplitude in Volts: dAmplitude...
  • Page 49: Set The Generator Dc Offset

    Set the generator DC Offset word SetFuncGenDCOffset( double dDCOffset ) This routine applies a DC offset to the output signal. The value is Description: entered in Volts. Input: the requested offset in Volts: dDCOffset -MaxAmpl <= value <= +MaxAmpl Output: E_NO_ERRORS Return value E_NO_GENERATOR...
  • Page 50: Set The Generator Signal Symmetry

    Set the generator signal symmetry word SetFuncGenSymmetry( double dSymmetry ) This routine sets the symmetry of the output signal. The symme- Description: try can be set between 0 and 100. With a symmetry of 50, the positive part of the output signal and negative part of the output signal are equally long.
  • Page 51: Set The Generator Frequency

    Set the generator frequency word SetFuncGenFrequency( double *dFrequency ) In DDS mode, this routine sets the output signal frequency of the Description: generator. In linear mode it sets the sample frequency of the generator. Input: : the requested frequency of the dFrequency DDS mode output signal:...
  • Page 52: Set The Generator Trigger Source

    Set the generator trigger source word SetFuncGenTrigSource( byte bySource ) The Handyscope HS3 function generator can be set to be started Description: by an external TTL trigger signal on pin 21 of the extension con- nector, see also the instrument manual, chapter 4. This routine sets the function generator trigger source: ltsExtTrig (4) a digital external signal...
  • Page 53: Fill The Function Generator Waveform Memory

    Fill the function generator waveform memory word FillFuncGenMemory( dword dwNrPoints, word *wFuncGenData ) This routine fills the function generator waveform memory with description: user defined data. The data must be in unsigned 16 bits values. A value of 0 corresponds to the negative full output scale, 32768 to 0 Volt and 65535 to the positive full output scale.
  • Page 54: Set The Generator Output State

    Set the generator output state word SetFuncGenOutputOn( word wValue ) For the TiePieSCOPE HS801 and the TP801 PCI/ISA, this routi- Description: ne switches the output of the function generator on or off. For the Handyscope HS3, this routine switches on the internal logic of the function generator, but does not start the generation of the signal.
  • Page 55: Set The Generator Enabled State

    Set the generator enabled state word SetFuncGenEnable( word wValue ) This routine enables the Handyscope HS3 function generator. Description: Prior to calling this function, the generator must have been swit- ched on using SetFuncGenOutputOn(). Input: The new enabled state wValue Stop signal generation Start signal generation E_NO_ERRORS...
  • Page 56: Generate Bursts

    Generate bursts word FuncGenBurst( word wNrPeriods ) This routine will make the Handyscope HS3 generator generate Description: a burst with a requested number of periods of the selected signal. When the burst is finished, the output will remain at the last ge- nerated amplitude value.
  • Page 57: Use The I C Bus

    Support of I C requires instrument drivers of version 6.0.5.0 or higher. If your driver version is lower, please refer to www.tiepie.nl for the latest version of the drivers. To control devices on this bus, the following routines are available.
  • Page 58: Write Data To The I C Bus

    Write data to the I C bus Two routines are available to write data to the I C bus. word I2CWrite( dword dwAddress, void * pBuf, dword dwSize ) Description: This routine writes the data that is placed in the memory where pBuf points to, to a specified address on the I C bus.
  • Page 59: Read Data From The I 2 C Bus

    Read data from the I C bus Two routines are available to read data from the I C bus. word I2CRead( dword dwAddress, void * pBuf, dword dwSize ) Description: This routine reads the data from a specified address on the I bus and places it in the memory where pBuf points to.
  • Page 60: Perform Resistance Measurements

    Perform resistance measurements Some instruments have special hardware to perform resistance measurements. Setup resistance measurements word SetupOhmMeasurements( word wMode ) This routine sets the instrument up to perform resistance measu- Description: rements. Several properties of the instrument are adapted: input sensitivity, signal coupling, record length, sampling frequency, auto ranging, trigger source, trigger timeout, acquisition mode.
  • Page 61: Deprecated Routines

    Deprecated routines The following described routines are considered obsolete. They were initially put in the DLL to perform measurements and collect the measured data. With the current instruments and computers, these routines will not give the required performance. Continuing using these functions is deprecated. Get the maximum sampling frequency dword GetMaxSampleFrequency( void ) Continuing using this routine is deprecated, use the routine...
  • Page 62: Get One Sample Of The Measurement Data, In Volts

    Get one sample of the measurement data, in Volts word GetOneMeasurement( dword wIndex, double *dCh1, double *dCh2 ) Continuing using this routine is deprecated. Get all measurement data, binary word GetMeasurementRaw( word *wCh1, word *wCh2 ) Continuing using this routine is deprecated, use the routine ADC_GetDataCh( ) instead.
  • Page 63: Retrieve The Measured Data In Volts

    Retrieve the measured data in Volts word ADC_GetDataVolt( double *dCh1, double *Ch2 ) Continuing using this routine is deprecated, use the routine ADC_GetDataVoltCh( ) instead. Get the current sampling frequency dword GetSampleFrequency( void ) Continuing using this routine is deprecated, use the routine GetSampleFrequencyF( ) instead.
  • Page 64: Set The Trigger Timeout Value

    Set the trigger timeout value word SetTriggerTimeOut( dword lTimeout ) Continuing using this routine is deprecated. The Trigger Timeout applies to measurements that are started with Note only routine StartMeasurement(). obsolete Measurements that are started using ADC_Start do react to the trigger timeout, the user will have to implement that self, by using ADC_ForceTrig Deprecated routines...
  • Page 65 Deprecated routines...
  • Page 66 If you have any suggestions and/or remarks concerning the DLLs or the manual, please contact: TiePie engineering Koperslagersstraat 37 8601 WL SNEEK The Netherlands Tel.: +31 (0)515 415 416 Fax: +31 (0)515 418 819 E_mail: support@tiepie.nl Website: www.tiepie.com...
  • Page 67 DLL programmer’s manual rev 1.26 TiePie engineering...

Table of Contents