Home

DEL-150/350 Dynamic Link Libraries User Manual

image

Contents

1. The following functions are implemented in the DEL DLL Initialisation functions DEL init DEL_get id DEL test_id DEL_get version DEL_set_ mode DEL_get mode DEL_get init status DEL _get_module_info DEL_test_ module DEL _get_error_string Setup functions DEL get parameters DEL set_parameters DEL set slope DEL set_threshold DEL set_output_pulse_width DEL set_output_pulse_level DEL invert_output_pulse DEL set delay range DEL set delay DEL set_start_delay DEL set_end_ delay DEL set_scan_repeat DEL set time _per_step DEL get_eeprom data DEL write_eeprom data DEL get _adjust_parameters DEL set_adjust_parameters DEL load_setup DEL save _ setup DEL activate_12V Scanning control functions DEL start_scan DEL stop_scan DEL reset_scan Status functions DEL test_if scanning DEL get delay DEL test_if triggered Functions listed above must be called with C calling convention which is default for C and C programs Identical set of functions is available for environments like Visual Basic which requires _stdcall calling convention Names of these functions have std letters after DEL for example DELstd_get delay it is _stdcall version of DEL_get_delay Description and behaviour of these functions are identical to the functions from the first default set the only difference is calling convention Application Guide Initialisation of the DEL Parameters Before the DEL
2. 3 DEL module number time new time value le 6 81 92 s Return value 0 no errors lt 0 error code 17 Description The procedure sets the time per delay step in the scanning mode The module to which the parameter applies is defined by mod_no Input parameters mod_no 0 3 DEL module number eep_ data pointer to result structure Return value 0 no errors lt 0 error code Description The structure eep_data is filled with the adjust and manufacturing parameters in the EEPROM of the DEL module specified by mod_no The structure DEL _ EEP Data is defined in the file del_def h Normally the EEPROM data need not be read explicitly because the EEPROM is read during DEL init and the module type information and the adjust values are taken into account when the DEL module registers are loaded short DEL_write_eeprom_data short mod_no unsigned short write_enable DEL_EEP Data far eep_data Input parameters mod_no 0 3 DEL module number write enable write enable password eep_ data pointer to result structure Return value 0 no errors lt 0 error code Description The function is used to write data to the EEPROM of an DEL module specified by mod_no To prevent corruption of the adjust data the function writes data to the EEPROM only if the write_enable password is correct Input parameters mod_no 0 3 DEL module number adjpara pointer to result structure Return value 0
3. defines which PCI bus with DEL 350 modules will be initialised value 0 255 defines specific bus number from the range 0 to number of PCI busses with DEL modules if pci_bus_ no is greater than number of PCI busses with DEL modules it is rounded to the number of busses 1 value 1 means that that the function will try to find DEL modules on all PCI busses The module will be initialised but only when it is not in use locked by other application valid only for DEL 350 modules After successful initialisation the module is locked to prevent that other application can access it valid only for DEL 350 modules The user should check initialisation status of all modules he wants to use by calling DEL_get_init_status function It is also recommended to call DEL get module_info function to get additional module s information If for some reasons the module which was locked must be initialised it can be done using the function DEL_set_mode with the parameter force_use 1 The initialisation file is an ASCII file with a structure as shown below We recommend either to use the file dell50 ini for initialisation or to start with dell50 ini and to introduce the desired changes DEL150 initialisation file DEL parameters have to be included in ini file only when parameter value is different from default base simulation 0 0 hardware mode default gt 0 simulation mode see del_def h for
4. module can be used the parameter values must be written into the internal structures of the DLL functions not directly visible from the user program and sent to the control registers of the DEL module This is accomplished by the function DEL_init The DEL DLL functions simultaneously control up to four DEL 150 350 modules The DEL_init function reads the parameter values from a specified file checks and recalculates the parameters depending on the hardware restrictions and the adjust parameters from the EEPROM on DEL module sends the parameter values to the DEL control registers performs a hardware test of the DEL module reads the parameter values from the auto cfg file and sends the values to the DEL control registers For this feature the use_auto_setup parameter in the ini file must be set to 1 and the auto cfg file must exists in DLL directory The initialisation file is an ASCII file with a structure as shown below We recommend either to use the file del150 ini for initialisation or to start with del150 ini and to introduce the desired changes DEL150 initialisation file DEL parameters have to be included in ini file only when parameter value is different from default base simulation 0 0 hardware mode default gt 0 simulation mode see del_def h for possible values baseadr 0x380 base I O address 0 Ox3FC default 0x380 use_auto_setup 0 load 1 or not 0 d
5. negative gt 0 positive 0 input signal disabled device not active short out12V 12V output active 1 default not active 0 only for DEL 350 modules To send the hardware parameters back to the DLLs and to the DEL module e g after changing parameter values the function DEL_set_parameters is used This function checks and if required recalculates all parameter values due to cross dependencies and hardware restrictions Therefore it is recommended to read the parameter values by DEL _get_ parameters after calling DEL_set_parameters The current state of the internal DELdata structure can be stored in a setup file extension cfg by the function DEL_save_setup A previously saved state can be to a DEL module by calling the DEL_load_setup function Single parameter values can be transferred to the DLL and module level by parameter specific functions e g for input signal slope use DEL_set_slope Error Handling Each DEL DLL function returns an error status Return values gt 0 indicate error free execution A value lt 0 indicates that an error occurred during the execution The meaning of a 6 particular error code can be found in del def h file and can be read using DEL_get_error_string We recommend to check the return value after each function call Description of the DEL DLL Functions Input parameters ini file pointer to a string the containing initialisation file name including file name and extension R
6. possible values baseadr 0x380 base I O address 0 Ox3FC default 0x380 use_auto_setup 0 load 1 or not 0 default parameters from setup file auto cfg at the end of initialisation pei_card no 0 number of the module on PCI bus if DEL 350 module 0 3 default 1 ISA module DEL 150 pci_bus no 1 PCI bus on which DEL 350 modules will be looking for 0 255 default 1 all PCI busses will be scanned device slope 1 input signal slope 1 negative 1 positive 0 input disabled default threshold 0 08 pa signal threshold V 2V 2V default 1 0 V out width 200 0 output signal width ns 2 2000 default 10 out_level 1 output signal level 0 TTL 1 NIM default delay_range 10 delay range ns 10 100000 default 100 delay 5 0 delay value ns 0 delay range default 50 start_delay 0 0 scan start delay value ns 0 delay range default 0 0 end_delay 5 0 scan end delay value ns 0 delay range default 50 time_per_step 0 001 time per one scan step sec le 6 81 92 default 0 001 scan_repeat 0 automatic repeat of scan action 0 off default 1 on outl2V 1 12V output active 1 default inactive 0 After calling the DEL_init function the measurement parameters from the initialisation file are present in the module control registers and in the internal data structures of the DLLs Input parameters mod_
7. will be copied Possible error_id values are defined in the del_def h file Input parameters mod_no 0 3 DEL module number data pointer to result structure type DELdata Return value 0 Description After calling the DEL_init function see above the measurement parameters from the initialisation file are present in the module and in the internal data structures of the DLLs To give the user access to the parameters the function DEL_get_parameters is provided This function transfers the parameter values of the module mod_no from the internal structures of the DLLs into a structure of the type DELdata see del_def h which has to be defined by the user The parameter values in this structure are described below base I O address auto cfg file was loaded during initialisation no of PCI module 0 3 or 1 for ISA module test EEPROM or not unsigned short base_adr short use_auto_ setup short pci_card_no unsigned short test_eep float threshold float out_width short out_level short out_invert float delay_range float delay float start_delay float end_delay float time_per_step short steps short scan_repeat short slope short outl2V input signal threshold V output signal width ns output signal level 0 TTL 1 NIM output signal inverted 1 or not 0 delay range ns delay ns start delay for scanning ns end delay for scanning ns time per one step change of delay du
8. Becker amp Hickl GmbH DEL_DLL DOC Nahmitzer Damm 30 12277 Berlin Tel 49 30 787 56 32 FAX 49 30 787 57 34 email info becker hickl de http www becker hickl de DEL 150 350 Dynamic Link Libraries User Manual Version 2 0 March 2003 Introduction The DEL 32 bit Dynamic Link Library contains all functions to control the DEL 150 350 ps Delay Generator modules The functions work under Windows 9x ME NT 2000 XP Up to four DEL modules can be controlled using the DEL DLL The program which calls the DLLs must be compiled with the compiler option Structure Alignment set to l Byte The distribution disks contain the following files DELDLL32 DLL dynamic link library main file DELDLL32 LIB import library file for Microsoft Visual C C Borland C C Watcom C C and Symantec C C compilers DEL_DEF H Include file containing type definitions functions prototypes and pre processor statements DEL150 INI DEL DLL initialisation file DEL_DLL DOC This description file USE _DEL XXX Set of files to compile and run a simple example of using the DEL DLL functions The source file of the example is the file use_del c The example was originally prepared under Borland C C V 4 52 For other compilers please choose the correct import library file to link There is no special installation procedure required Simply execute the setup program from the Ist distribution diskette and follow its instructions DEL DLL Functions list
9. ated depending on the parameters delay range start_delay and end_delay The number of steps is a field of the DELdata structure and can be read by DEL get parameters When end delay is reached the scanning action is stopped or if scan _ repeat is set starts from the beginning start_delay The current delay during the scanning can be read from the module by the DEL get delay function The function DEL test_if scanning can be used to check whether the scanning action is still in progress Once started the scanning is controlled essentially by the DEL hardware Therefore it is not influenced by the processor speed by other programs running at the same time or by interrupts 20 Input parameters mod_no 0 3 DEL module number Return value 0 no errors lt 0 error code Description The function is used to stop a current scanning action After being stopped the scanning can be continued from the current state by the function DEL_start_scan To reset the scan state the DEL_reset_scan function is provided The current delay can be read by the function DEL get delay If DEL_stop_scan is called with no scanning action started an error is returned Input parameters mod_no 0 3 DEL module number Return value 0 no errors lt 0 error code Description The function is used to reset the current scanning action The scanning action is stopped and the current delay is set to start dela
10. e function is used to store the DEL module parameters to the file setup _file The file can be loaded back by the DEL_load setup function The file contains a copy of internal DLL DEL data structure Input parameters mod_no 0 3 DEL module number setup _file pointer to string containing setup file name and path 19 Return value 0 no errors lt 0 error code Description The function is used to replace the parameters of a DEL module with the settings from the file setup_file This file is created by the DEL save_setup function and contains a copy of the internal DLL DELdata structure Input parameters mod_no 0 3 DEL module number active 1 activate 0 deactivate 12V output on DEL 350 module Return value 0 no errors lt 0 error code Description The procedure activates deactivates the 12V output for the DEL 350 module defined by mod no Input parameters mod _no 0 3 DEL module number Return value 0 no errors lt 0 error code Description The function is used to start the scanning action or to continue a scanning action which was interrupted by the function DEL stop scan Before starting the scanning action the scanning parameters start_delay end delay time per step and scan repeat must be set During the scanning action the DEL module automatically changes its delay starting from start_delay up to end_ delay The number of delay steps is calcul
11. efault parameters from setup file auto cfg at the end of initialisation pei_card no 0 number of the module on PCI bus if DEL 350 module 0 3 default 1 ISA module DEL 150 pci_bus_no 1 PCI bus on which DEL 350 modules will be looking for 0 255 default 1 all PCI busses will be scanned device slope 1 null signal slope 1 negative 1 positive 0 input disabled default threshold 0 08 input signal threshold V 2V 2V default 1 0 V out_width 200 0 output signal width ns 2 2000 default 10 out_level 1 output signal level 0 TTL 1 NIM default delay_range 10 delay range ns 10 100000 default 100 delay 5 0 delay value ns 0 delay range default 50 start_delay 0 0 scan start delay value ns 0 delay range default 0 0 end_delay 5 0 scan end delay value ns 0 delay range default 50 time_per_ step 0 001 time per one scan step sec le 6 81 92 default 0 001 scan_repeat 0 automatic repeat of scan action 0 off default 1 on outl2V 1 12V output active 1 default inactive 0 only for DEL 350 modules The DEL init function initialises one DEL module normally the first one depending on pei_card no value in ini file Module number to be used in subsequent calls to DLL functions is normally 0 and can be found by checking which module is in use see DEL _get_module_info function To initia
12. eturn value returns error code 0 success lt 0 error DEL init initialises the library internal structures with parameters from the configuration file ini file recommended extension ini and initialises the internal registers of the DEL module The DEL_init function reads the parameter values from a specified file ini file checks the base I O addresses for all active modules to avoid hardware conflicts checks and recalculates the parameters depending on hardware restrictions and the adjust parameters from the EEPROM on the DEL module sends the parameter values to the DEL control registers performs a hardware test of the DEL module reads the parameter values from the auto cfg file and sends the values to the DEL control registers For this feature the use_auto_setup parameter in the ini file must be set to 1 and the auto cfg file must exists in DLL directory The DEL module which will be initialised is defined by pci_bus_ no and pci_card_no parameter from ini_file pei_card_no defines which DEL module on PCI or ISA bus to be initialised value 0 3 defines one specific DEL 350 module if pci_card_no is greater than number of DEL 350 modules on PCI bus it is rounded to the number of modules 1 value 1 means that that the function will try to initialise DEL 150 module on ISA bus using baseadr from ini file as a base IO address pci_bus_ no
13. hold new threshold value 2V 2V Return value 0 no errors lt 0 error code 14 Description The procedure sets the trigger threshold for the DEL module defined by mod_no Input parameters mod_no 0 3 DEL module number width new width value 2 to 2000 ns Return value 0 no errors lt 0 error code Description The procedure sets the output pulse width for the DEL module defined by mod_no Input parameters mod_no 0 3 DEL module number level new level value 0 TTL 1 NIM Return value 0 no errors lt 0 error code Description The procedure sets the level of the output signal for the DEL module defined by mod_no Input parameters mod_no 0 3 DEL module number invert new invert value 0 no inversion inversion Return value 0 no errors lt 0 error code Description The procedure is used to set the logical polarity of the output signal non inverted inverted The module to which the setting applies is defined by mod_no 15 Input parameters mod_no 0 3 DEL module number range new range value 10 to 100000 ns Return value 0 no errors lt 0 error code Description The procedure sets the delay range for the DEL module defined by mod_no In order to avoid discontinuities in the delay scale we recommend to set range to the maximum required delay value and to control the delay by DEL _set_delay Input parameters mod_no 0 3 DEL mod
14. lation Mode or vice versa The simulation mode is used to run the software without the DEL module or in case of hardware errors found during the DEL init call Use DEL_get_mode to check the actual mode after the call to DEL_set_mode Input parameters none Return value DLL operation mode The procedure returns the current DLL operation mode Possible mode values are defined in the del_def h file define DEL HARD 0 hardware mode define DEL_SIMUL150 150 simulation mode of DEL 150 module define DEL_SIMUL350 350 simulation mode of DEL 350 module Input parameters mod_no 0 3 DEL module number Return value initialisation result code of the DEL module mod_no Description The procedure returns the initialisation result code set by the function DEL init or DEL _set_mode The possible values are shown below see also del_def h 11 INIT _OK 0 no error INIT_NOT_DONE 1 init not done INIT WRONG EEP CHKSUM 2 wrong EEPROM checksum INIT_WRONG MOD ID 3 wrong module identification code INIT_WRONG_TRIGGER 4 trigger test failed INIT_WRONG_DACS 5 DAC s test failed INIT_CANT_OPEN PCI CARD 6 cannot open PCI card INIT _WINDRVR_VER 7 incorrect WinDriver version INIT MOD _IN USE 8 module in use locked cannot initialise INIT_ WRONG LICENSE 9 wrong or missing license key Input parameters mod _no 0 3 DEL module number mod info pointer to result structure type DELModInfo Return va
15. lise more or other DEL modules if there are any DEL_set mode function is used After calling the DEL_init function the measurement parameters from the initialisation file are present in the module control registers and in the internal data structures of the DLLs To give the user access to the parameters the function DEL_get_parameters is provided This function transfers the parameter values from the internal structures of the DLLs into a structure of the type DELdata see del_def h which has to be defined by the user The parameter values in this structure are described below base I O address auto cfg file was loaded during initialisation unsigned short base_adr short use_auto_ setup short pci_card_no unsigned short test_eep float threshold float out_width short out_level short out_invert float delay_range float delay float start_delay float end_delay float time_per_step no of PCI module 0 3 or 1 for ISA module test EEPROM or not input signal threshold V output signal width ns output signal level 0 TTL 1 NIM output signal inverted 1 or not 0 delay range ns delay ns start delay for scanning ns end delay for scanning ns time per one step change of delay during scanning s one step change 4095 actual delay range short steps number of steps in scanning action short scan_repeat automatically repeat scanning or not short slope input signal slope lt 0
16. lue 0 no errors lt 0 error code see del_def h Description After calling the DEL_init or DEL_set_mode function see above the DELModInfo internal structures for all 4 modules are filled This function transfers the contents of the internal structure of the DLL into a structure of the type DELModInfo see del_def h which has to be defined by the user The parameters included in this structure are described below short module_type DEL module type see del_def h short bus_number PCI bus number of the module short slot_number slot number on PCI bus bus_number occupied by the module short in_use 1 used and locked by other application 0 not used 1 in use short init set to initialisation result code unsigned short base_adr base I O address on PCI bus Input parameters mod_no 0 3 DEL module number Return value 0 no errors lt 0 error code Description The procedure performs a hardware test of DEL module This is low level procedure called already during the initialisation by DEL init Input parameters error_id DEL DLL error id 0 number of DEL errors 1 see del_def h file 12 dest_string pointer to destination string max length max number of characters which can be copied to dest_string Return value 0 no errors lt 0 error code The procedure copies to dest_string the string which contains the explanation of the DEL DLL error with id equal error_id Up to max_length characters
17. no 0 3 DEL module number id pointer to the identification code Return value 0 no errors lt 0 error code Description The procedure loads the id variable with the identification code of the DEL module mod no DEL get id is a low level procedure which is already called during the initialisation by DEL init Therefore a call of DEL get id is not normally required for standard applications Input parameters mod_no 0 3 DEL module number Return value 0 correctid lt 0 error code Description The procedure checks whether the DEL module mod_no has the correct identification code DEL test_id is a low level procedure which is already called during the initialisation by DEL init Therefore a call of DEL get id is not normally required for standard applications Input parameters mod_no 0 3 DEL module number version pointer to the version variable Return value 0 no errors lt O error code Description The procedure loads the version variable with the FPGA identification code ofthe DEL module mod_no DEL_get version is a low level procedure not needed normally Input parameters mode mode of DLL operation force _use force using the module ifthey are locked in use in use pointer to the table with information which module must be used Return value on success DLL mode gt 0 lt 0 error code Description The procedure is used to change the mode of the DLL o
18. no errors lt 0 error code 18 Description The structure adjpara is filled with the adjust parameters that are currently in use The parameters can either be previously loaded from the EEPROM by DEL init or DEL get_eeprom data or not recommended set by DEL _set_adust_parameters The structure DEL Adjust_Para is defined in the file del_def h Normally the adjust parameters need not be read explicitly because the EEPROM is read during DEL init and the adjust values are taken into account when the DEL module registers are loaded Input parameters mod_no 0 3 DEL module number adjpara pointer to result structure Return value 0 no errors lt 0 error code Description The adjust parameters in the internal DLL structures not in the EEPROM are set to values from the structure adjpara The function is used to set the module adjust parameters to values other than the values from the EEPROM The new adjust values will be used until the next call of DEL init The next call to DEL init replaces the adjust parameters with the values from the EEPROM We strongly discourage to use modified adjust parameters because the module function can be seriously impaired by wrong adjust values The structure DEL Adjust_Para is defined in the file del_def h Input parameters mod_no 0 3 DEL module number setup_file pointer to string containing setup file name and path Return value 0 no errors lt 0 error code Description Th
19. peration between the hardware mode and the simulation mode It is also used to switch the DLL to the simulation mode if hardware errors occur during the initialisation Table in use should contain entries for all 4 modules 0 means that the module will be unlocked and not used longer 10 1 means that the module will be initialised and locked When the Hardware Mode is requested for each of 4 possible modules if in_use entry the proper module is locked and initialised if it wasn t with the initial parameters set from ini_file but only when it was not locked by another application or when force_use 1 if in_use entry 0 the proper module is unlocked and cannot be used further When one of the simulation modes is requested for each of 4 possible modules if in_use entry 1 the proper module is initialised if it wasn t with the initial parameters set from ini_file if in_use entry 0 the proper module is unlocked and cannot be used further Errors during the module initialisation can cause that the module is excluded from use Use the function DEL_get_init_status and or DEL_get_module_info to check which modules are correctly initialised and can be use further Use the function DEL_get mode to check which mode is actually set Possible mode values are defined in the del_def h file The procedure is used to change the DLL operating mode from Hardware Mode to Simu
20. ring scanning s one step change 4095 actual delay range number of steps in scanning action automatically repeat scanning or not input signal slope lt 0 negative gt 0 positive 0 input signal disabled device not active 12V output active 1 default not active 0 only for DEL 350 modules 13 Input parameters mod_no 0 3 DEL module number data pointer to result structure type DELdata Return value 0 no errors lt 0 error code Description The procedure sends all parameters from the data structure to the internal DLL structures and to the control registers of the DEL module The new parameter values are recalculated according to the parameter limits or hardware restrictions e g DAC resolution Furthermore cross dependencies between different parameters are taken into account to ensure the correct hardware operation It is recommended to read back the parameters after setting to get their real values after recalculation The values of base_adr pci_card_no and test_eep are not changed They can be changed only by anew config file and a new DEL init call Input parameters mod_no 0 3 DEL module number slope new slope value 1 negative 1 positive 0 input disabled Return value 0 no errors lt 0 error code Description The procedure sets the trigger slope for the DEL module defined by mod_no Input parameters mod_no 0 3 DEL module number thres
21. ule number delay new delay value 0 to delay range ns Return value 0 no errors lt 0 error code Description The procedure sets the delay value for the DEL module mod_no The delay can be set to any value within the Delay Range set by DEL set delay range The module to which the parameter applies is defined by mod_no On order to avoid discontinuities in the delay scale we recommend to set Range to the maximum required delay value and to essentially control the delay by DEL _set_delay Input parameters mod_no 0 3 DEL module number delay new start delay value 0 to delay range ns Return value 0 no errors lt 0 error code 16 Description The procedure sets the start delay value used in the scanning mode The module to which the parameter applies is defined by mod_no Input parameters mod_no 0 3 DEL module number delay new end delay value 0 delay range ns Return value 0 no errors lt 0 error code Description The procedure sets the start delay value used in the scanning mode The module to which the parameter applies is defined by mod_no Input parameters mod_no 0 3 DEL module number repeat automatic repeat of scan action 0 off 1 on Return value 0 no errors lt 0 error code Description The procedure switches on off the automatic repeating of scanning action for the DEL module defined by mod_no Input parameters mod_no 0
22. y Input parameters mod _no 0 3 DEL module number Return value gt 0 no errors scanning status lt 0 error code Description The function is used to test the state of the scanning action The function returns the status of the scanning action Possible status values are listed below see also del_def h file STATUS RESET 100 STATUS STOP 200 STATUS_SCAN 300 STATUS READY 400 21 Input parameters mod_no 0 3 DEL module number delay pointer to variable which will be filled with delay value Return value 0 no errors lt 0 error code Description The function sets the delay variable to the actual delay value in ns of the DEL module mod no Input parameters mod _no 0 3 DEL module number triggered pointer to variable to be set Return value 0 no errors lt 0 error code Description The function sets the triggered variable to 0 if the DEL module mod_no was not triggered or to 1 if the module was triggered since the initialisation or since the last call of DEL test if triggered 22

Download Pdf Manuals

image

Related Search

Related Contents

1 - Billiger.de  DSLR-A900  CMS Front-End Driver PMC  GigBAR IRC User Manual Rev. 3 Multi-Language    Edital - Centro Paula Souza - Governo do Estado de São Paulo  EMBLEM EASYLAM Avantgarde 1600  Zoom Manuale Tecnico Rev.05-07  nüLink!™ série 2300  

Copyright © All rights reserved.
Failed to retrieve file