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.
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...
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.
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:...
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...
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-...
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:...
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.
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...
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...
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.
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.
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;...
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.
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.
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).
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.
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.
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:...
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.
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.
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.
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...
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.
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.
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.
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.
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...
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...
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.
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.
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.
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:...
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.
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.
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-...
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.
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:...
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...
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...
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.
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:...
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...
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.
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.
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...
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.
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.
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.
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.
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.
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...
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.
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.
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 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...