background image

Acquisition modes

Overview

(c) Spectrum GmbH

69

Acquisition modes

Your card is able to run in different modes. Depending on the selected mode there are different registers that each define an aspect of this 
mode. The single modes are explained in this chapter. Any further modes that are only available if an option is installed on the card is doc-
umented in a later chapter.

Overview

This chapter gives you a general overview on the related registers for the different modes. The use of these registers throughout the different 
modes is described in the following chapters.

Setup of the mode

The mode register is organized as a bitmap. Each mode corresponds to one bit of this bitmap. When defining the mode to use, please be 
sure just to set one of the bits. All other settings will return an error code.

The main difference between all standard and all FIFO modes is that the standard modes are limited to on-board memory and therefore can 
run with full sampling rate. The FIFO modes are designed to transfer data continuously over the bus to PC memory or to hard disk and can 
therefore run much longer. The FIFO modes are limited by the maximum bus transfer speed the PC can use. The FIFO mode uses the complete 
installed on-board memory as a FIFO buffer. 

However as you’ll see throughout the detailed documentation of the modes the standard and the FIFO mode are similar in programming and 
behavior and there are only a very few differences between them. 

Acquisition modes

 

Register

Value

Direction

Description

SPC_CARDMODE

9500

read/write

Defines the used operating mode, a read command will return the currently used mode.

SPC_AVAILCARDMODES

9501

read

Returns a bitmap with all available modes on your card. The modes are listed below.

Mode

Value

Description

SPC_REC_STD_SINGLE

1h

Data acquisition to on-board memory for one single trigger event.

SPC_REC_STD_MULTI

2h

Data acquisition to on-board memory for multiple trigger events. Each recorded segment has the same size. This mode is described in greater 
detail in a special chapter about the Multiple Recording option.

SPC_REC_STD_GATE

4h

Data acquisition to on-board memory using an external Gate signal. Acquisition is only done as long as the gate signal has a programmed 
level. The mode is described in greater detail in a special chapter about the Gated Sampling option.

SPC_REC_STD_ABA

8h

Data acquisition to on-board memory for multiple trigger events. While the multiple trigger events are stored with programmed sampling rate 
the inputs are sampled continuously with a slower sampling speed. The mode is described in a special chapter about ABA mode option.

SPC_REC_FIFO_SINGLE

10h

Continuous data acquisition for one single trigger event. The on-board memory is used completely as FIFO buffer.

SPC_REC_FIFO_MULTI

20h

Continuous data acquisition for multiple trigger events.

SPC_REC_FIFO_GATE

40h

Continuous data acquisition using an external gate signal.

SPC_REC_FIFO_ABA

80h

Continuous data acquisition for multiple trigger events together with continuous data acquisition with a slower sampling clock.

Summary of Contents for M2i.3010

Page 1: ... PHONE 49 0 4102 6956 0 FAX 49 0 4102 6956 66 E MAIL info spec de INTERNET www spectrum instrumentation com M2i 30xx M2i 30xx exp fast 12 bit transient recorder A D converter board for PCI X PCI and PCI Express bus Hardware Manual Software Driver Manual English version May 24 2018 ...

Page 2: ...of Embarcadero Technologies Inc Keysight VEE VEE Pro and VEE OneLab are trademarks registered trademarks of Keysight Technologies Inc FlexPro is a registered trademark of Weisang GmbH Co KG PCIe PCI Express PCI X and PCI SIG are trademarks of PCI SIG PICMG and CompactPCI are trademarks of the PCI Industrial Computation Manufacturers Group PXI is a trademark of the PXI Systems Alliance LXI is a reg...

Page 3: ...s 20 Sources of noise 20 Installing the board in the system 21 Installing a single board without any options 21 Installing a board with digital inputs outputs mounted on an extra bracket 23 Installing a board with option BaseXIO 24 Installing multiple boards synchronized by star hub option 25 Software Driver Installation 26 Windows 26 Before installation 26 Running the driver Installer 26 After in...

Page 4: ...th SBench 6 39 C C Driver Interface 39 Header files 40 General Information on Windows 64 bit drivers 40 Microsoft Visual C 6 0 2005 and newer 32 Bit 40 Microsoft Visual C 2005 and newer 64 Bit 40 C Builder 32 Bit 41 Linux Gnu C C 32 64 Bit 41 C for NET 41 Other Windows C C compilers 32 Bit 41 Other Windows C C compilers 64 Bit 41 National Instruments LabWindows CVI 42 Driver functions 42 Delphi Pa...

Page 5: ...68 Acquisition modes 69 Overview 69 Setup of the mode 69 Commands 70 Card Status 71 Acquisition cards status overview 71 Generation card status overview 71 Data Transfer 72 Standard Single acquisition mode 74 Card mode 74 Memory Pre and Posttrigger 74 Example 74 FIFO Single acquisition mode 75 Card mode 75 Length and Pretrigger 75 Difference to standard single acquisition mode 75 Example FIFO acqu...

Page 6: ...g examples 108 Mode Gated Sampling 109 Acquisition modes 109 Standard Mode 109 FIFO Mode 109 Limits of pre trigger post trigger memory size 110 Gated Sampling and Timestamps 110 Trigger 111 Trigger Output 111 Edge and level triggers 111 Pulsewidth triggers 114 Channel triggers modes 115 Programming examples 119 Timestamps 120 General information 120 Example for setting timestamp mode 120 Limits 12...

Page 7: ...un the synchronized cards 143 Error Handling 144 Excluding cards from trigger synchronization 144 SH Direct using the Star Hub clock directly without synchronization 144 Option System Star Hub 146 Overview 146 Cabling the system components 146 Setting up the master system 146 Setting up slave systems 147 Connecting the systems 147 Programming 148 Necessary setup steps 148 Select synchronization mo...

Page 8: ...transfer rate 160 Background 160 Setup on Linux systems 161 Setup on Windows systems 161 Usage of the buffer 162 Pin assignment of the multipin connector 163 Option Digital inputs 163 Pin assignment of the multipin cable 164 IDC footprints 164 Details on M2i cards clock and trigger I O section 165 ...

Page 9: ...tandards available for instrumentation boards Special industrial PCs offer up to a maximum of 20 slots The common PCI PCI X bus with data rates of up to 133 MHz x 64 bit 1 GByte s per bus is more and more replaced by the PCI Express standard with up to 4 GByte s data transfer rate per slot The Spectrum M2i boards are available in two versions for PCI PCI X as well as for PCI Express The 100 softwa...

Page 10: ... 30xx series They differ in the number mounted acquisition modules and the number of available channels You can also see the model dependent allocation of the output connectors M2i 3010 M2i 3020 M2i 3010 exp M2i 3020 exp M2i 3011 M2i 3012 M2i 3021 M2i 3022 M2i 3031 M2i 3011 exp M2i 3012 exp M2i 3021 exp M2i 3022 exp M2i 3031 exp M2i 3015 M2i 3025 M2i 3027 M2i 3015 exp M2i 3025 exp M2i 3027 exp ...

Page 11: ... Different models of the M2i 30xx series c Spectrum GmbH 11 M2i 3013 M2i 3014 M2i 3016 M2i 3023 M2i 3024 M2i 3026 M2i 3033 M2i 3013 exp M2i 3014 exp M2i 3016 exp M2i 3023 exp M2i 3024 exp M2i 3026 exp M2i 3033 exp ...

Page 12: ...if the synchronization star hub is used The cable connection of the boards is automatically recognized and checked by the driver when initializing the star hub module So no care must be taken on how to cable the cards The star hub module itself is handled as an additional device just like any other card and the pro gramming consists of only a few additional commands System Star Hub The System Star...

Page 13: ...MCX connectors are mounted on board To gain easier access these lines are connected to an extra bracket that holds eight SMB male connectors For special purposes this option can also be ordered without the extra bracket and instead with internal cables The shown option is mounted exemplarily on a board with two modules and with the extra bracket Of course you can also combine this option as well w...

Page 14: ...n this example the options Multiple recording Gated Sampling Timestamp and Star Hub 5 are installed The base card version consisting of the hardware version the part before the dot and the firmware version the part after the dot The version of the analog digital front end module Consisting of the hardware version the part before the dot and the firmware version the part after the dot The date of p...

Page 15: ...Introduction Hardware information c Spectrum GmbH 15 Hardware information Block diagram ...

Page 16: ...ible 5V tolerant with base card hardware version V20 External trigger input Low 0 8 V High 2 0 V 8 ns in pulse stretch mode 2 clock periods all other modes External trigger maximum voltage 0 5 V up to 5 7 V internally clamped to 5 0V 100 mA max clamping current Trigger impedance software programmable 50 Ohm high impedance 4kOhm External trigger output type 3 3 V LVTTL External trigger output level...

Page 17: ...idth with option BaseXIO additionally extra bracket on neighbour slot Width with option digin digout or 60xx AmpMod additionally half length of adjacent neighbour slot Weight depending on version 290g smallest version up to 460g biggest version with all options including star hub Warm up time 10 minutes Operating temperature 0 C to 50 C Storage temperature 10 C to 70 C Humidity 10 to 90 PCI PCI X ...

Page 18: ...50 MS s 62 5 MS s 80 MS s 105 MS s 160 MS s 200 MS s min external clock 1 MS s 1 MS s 1 MS s 1 MS s 1 MS s 1 MS s 1 MS s max external clock 40 MS s 50 MS s 62 5 MS s 80 MS s 105 MS s 80 MS s 105 MS s 3 dB bandwidth DC to 20 MHz DC to 25 MHz DC to 30 MHz DC to 40 MHz DC to 40 MHz DC to 40 MHz DC to 40 MHz Zero noise level 125 MS s 1 1 LSB rms 1 1 LSB rms 1 4 LSB rms 1 5 LSB rms 1 5 LSB rms 2 0 LSB ...

Page 19: ...on included M2i xxxx SSHMe 1 System Star Hub Master for up to 15 cards in the system and up to 17 systems PCI Express card sync cables and extra bracket for clock and trigger distribution included M2i xxxx SSHS5 1 System Star Hub Slave for 5 cards in one system one slot width all sync cables bracket included M2i xxxx SSHS16 1 System Star Hub Slave for 16 cards in system two slots width all sync ca...

Page 20: ...x series contain electronic components that can be damaged by electrostatic discharge ESD Before installing the board in your system or even before touching it it is absolutely necessary to bleed off any electrostatic electricity Cooling Precautions The boards of the M2i M3i xxxx series operate with components having very high power consumption at high speeds For this reason it is absolutely requi...

Page 21: ... board slowly into your computer This is done best with one hand each at both fronts of the board While inserting the board take care not to tilt the retainer in the track Please take especial care to not bend the card in any direction while inserting it in the system A bending of the card may damage the PCB totally and is not covered by the standard warranty Please be very carefully when insertin...

Page 22: ... 30xx exp Manual Installing the board in the system Hardware Installation Installing the M2i M3i xxxx exp PCI Express card in a PCIe x1 slot Installing the M2i M3i xxxx exp PCI Express card in a PCIe x4 x8 or x16 slot ...

Page 23: ...oard and the extra bracket slowly into your computer This is done best with one hand each at both fronts of the board While inserting the board take care not to tilt the retainer in the track Please take especial care to not bend the card in any direction while inserting it in the system A bending of the card may damage the PCB totally and is not covered by the standard warranty Please be very car...

Page 24: ...e extra bracket slowly into your computer This is done best with one hand each at both fronts of the board While inserting the board take care not to tilt the retainer in the track Please take especial care to not bend the card in any direction while inserting it in the system A bending of the card may damage the PCB totally and is not covered by the standard warranty Please be very carefully when...

Page 25: ...odule are available see figure for details on the star hub connector loca tions As some of the synchronization cables are not secured against wrong plugging you should take care to have the pin 1 markers on the multiple connectors and the cable on the same side as the figure on the right is showing Mounting the wired boards Before installing the cards you first need to unscrew and remove the dedic...

Page 26: ...s 7 Windows 8 and Windows 10 both 32bit and 64bit The driver from the CD supports all cards of the M2i M3i or M4i M4x series That means that you can use the same driver for all cards of these families Windows Before installation When you install a card for the very first time Windows will dis cover the new hardware and might try to search the Microsoft Website for available matching driver modules...

Page 27: ...allation Windows c Spectrum GmbH 27 After installation After running the Spectrum driver installer the card will appear in the Windows device manager with its name matching the card se ries The card is now ready to be used ...

Page 28: ...nly needed if you are operating real locally installed cards For software emulated demo cards remotely installed cards or for digitizerNETBOX generatorNETBOX products it is only necessary to in stall the libraries as explained further below Login as root It is necessary to have the root rights for installing a driver Call the install sh install_path script This script will install the kernel modul...

Page 29: ...all script and install the just compiled kernel module in your home directory The rest of the installation procedure is similar as explained above Update of self compiled kernel driver If the kernel driver has changed one simply has to perform the same steps as shown above and recompile the kernel driver module However the kernel driver module isn t changed very often Normally an update only needs...

Page 30: ...xtract the files from the rpm matching your distribution You get the directory structure and the files contained in the rpm package Copy the binary spcmcontrol to usr bin Copy the desktop file to usr share applications Run ldconfig to update your systems library cache Finally you can run spcmcontrol Troubleshooting If you get a message like the following after starting spcmcontrol Run ldd spcm_con...

Page 31: ...ocument and is described with separate manuals available on the CD or on the website Card Control Center A special card control center is available on CD and from the internet for all Spec trum M2i M3i M4i M4x M2p cards and for all digitizerNETBOX or generatorNETBOX products Windows users find the Control Center installer on the CD under Install win spcmcontrol_install exe Linux users find the ver...

Page 32: ... it the previously found remote products are shown with the prefix cached only showing the card type and the serial number This is the stored information that allows other Spectrum products to access previously found cards Using the Update cached cards button will try to re open these cards and gather information of it Afterwards the remote cards may disappear if they re in use from somewhere else...

Page 33: ... as shown in the picture on the right will open up a context menu In here one can again select to hide show the Netbox Monitor status window one can directly open the web interface from here or quit the program including the tray icon completely The checkbox Show Status Message controls whether the tray icon should emerge a status message on status change If enabled which is default one is notifie...

Page 34: ...e on how to update the firmware of your Spec trum card with the help of the card control center is described in a dedicated section later on The procedure on how to update the firmware of your digitizerNETBOX generatorNETBOX with the help of the in tegrated Webserver is described in a dedicated chapter later on Software License information This sub tree is informing about installed possible softwa...

Page 35: ...ards are only meant to test soft ware and to show certain abilities of the software They do not sim ulate the complete behavior of a card especially not any timing concerning trigger recording length or FIFO mode notification The demo card will calculate data every time directly after been called and give it to the user application without any more delay As the calculation routine isn t speed opti...

Page 36: ...unning on that system The speed test program runs the following two tests Repetitive Memory Transfers single DMA data trans fers are repeated and measured This test simulates the measuring of pulse repetition frequency when doing multiple single shots The test is done using dif ferent block sizes One can estimate the transfer in relation to the transferred data size on multiple single shots FIFO m...

Page 37: ...ation Please keep in mind that a detailed logging in append mode can quickly gener ate huge log files Device mapping Within the Device mapping tab of the Spectrum Control Center one can en able the re mapping of Spectrum devices be it either local cards remote instru ments such as a digitizerNETBOX or generatorNETBOX or even cards in a remote PC and accessed via the Spectrum remote server option I...

Page 38: ...t will be affected with the update are marked as update needed Simply start the update or cancel the operation now as a running update cannot be aborted Please keep in mind that you have to start the update for each card installed in your system separately Select one card after the other from the listbox and press the firmware update button The firmware in staller on the other hand only needs to b...

Page 39: ...ording The M2i cards now have a programmable pre trigger size When using the compatibility layer this pretrigger is set to the minimum and data will be visible before the trigger event Although the application software doesn t see a difference between old an new cards there is no chance to synchronize both card types together as the synchronization option uses different connectors different signal...

Page 40: ... separate subdirectory These examples show different aspects of the cards like programming options or synchronization and can be combined with one of the board type specific examples As the examples are build for a card class there are some checking routines and differentiation between cards families Differentiation aspects can be number of channels data width maximum speed or other details It is ...

Page 41: ...g Borland offers the implib tool that generates a matching library out of the windows driver DLL If such a tool is available it is recommended to use it Otherwise the driver functions need to be loaded from the dll using standard Windows functions There is one exam ple in the example directory examples c_cpp dll_loading that shows the process Example of function loading Other Windows C C compilers...

Page 42: ...the function returns a NULL When calling this function all card specific installation parameters are read out from the hardware and stored within the driver It is only possible to open one device by one software as concurrent hardware access may be very critical to system stability As a result when trying to open the same device twice an error will be raised and the function returns NULL Function ...

Page 43: ...are settings are based on software registers that can be read by one of the functions spcm_dwGetParam These functions read an internal register or status information The board must first be initialized by the spcm_hOpen function The parameter lRegister must have a valid software register constant as defined in the regs h file The available software registers for the driver are listed in the board ...

Page 44: ...Value pointer for the return value int32 lSerialNumber spcm_dwGetParam_i32 hDrv SPC_PCISERIALNO lSerialNumber printf Your card has serial number 05d n lSerialNumber Internal register read write Function type Behavior 32 bit register read spcm_dwGetParam_i32 value is returned as 32 bit integer in plValue 32 bit register read spcm_dwGetParam_i64 value is returned as 64 bit integer in pllValue 32 bit...

Page 45: ...cessary to use the same buffer type as the driver handles different buffers at the same time Call this function if you want to delete the buffer memory after calling the spcm_dwDefTransfer function If the buffer already has been transferred after calling spcm_dwDefTransfer it is not necessary to call this function When calling spcm_dwDefTransfer any further defined buffer is automatically invalida...

Page 46: ...nally as it is not locking the driver but as a valid event Therefore the GetErrorInfo function won t return the timeout event even if it had occurred in between You can only recognize the ERR_TIMEOUT as a direct return value of the wait function that was called Function spcm_dwGetErrorInfo Example uint32 _stdcall spcm_dwInvalidateBuf invalidate the transfer buffer drv_handle hDevice handle to an a...

Page 47: ...ng the driver files in the project it is also necessary to include them in the uses section of the source files where functions or constants should be used device handling functions function spcm_hOpen strName pchar int32 stdcall external spcm_win32 dll name _spcm_hOpen 4 procedure spcm_vClose hDevice int32 stdcall external spcm_win32 dll name _spcm_vClose 4 function spcm_dwGetErrorInfo_i32 hDevic...

Page 48: ...e implements a very simple scope program that makes single acquisitions on button pressing A fixed setup is done inside the example The spcm_scope example can be used with any analog data acquisition card from Spectrum It covers cards with 1 byte per sample 8 bit resolution as well as cards with 2 bytes per sample 12 14 and 16 bit resolution The program shows the following steps Initialization of ...

Page 49: ...vice As Long As Long Public Declare Function spcm_dwGetErrorInfo_i32 Lib spcm_win32 dll Alias _spcm_dwGetErrorInfo_i32 16 ByVal hDevice As Long ByRef lErrorReg ByRef lErrorValue ByVal szErrorText As String As Long software register handling Public Declare Function spcm_dwGetParam_i32 Lib spcm_win32 dll Alias _spcm_dwGetParam_i32 12 ByVal hDevice As Long ByVal lRegister As Long ByRef lValue As Long...

Page 50: ...e example implements a very simple scope program that makes single acquisitions on button pressing A fixed setup is done inside the example The spcm_scope example can be used with any analog data acquisition card from Spectrum It covers cards with 1 byte per sample 8 bit resolution as well as cards with 2 bytes per sample 12 14 and 16 bit resolution The program shows the following steps Initializa...

Page 51: ...ocated in the directory SpcmDrv NET Using C The SpcmDrv NET dll needs to be included within the Solution Explorer in the References section Please use right mouse and select AddReference After this all functions and constants of the driver object are available Please see the example in the directory CSharp as a start Example for digitizerNETBOX generatorNETBOX and remotely installed cards namespac...

Page 52: ...er object are available Please see the example in the directory JSharp as a start Example for digitizerNETBOX generatorNETBOX and remotely installed cards open card hDevice Drv spcm_hOpen dev spcm0 if int hDevice 0 Console WriteLine Error Could not open card n return 1 get card type dwErrorCode Drv spcm_dwGetParam_i32 hDevice Regs SPC_PCITYP lCardType dwErrorCode Drv spcm_dwGetParam_i32 hDevice Re...

Page 53: ...aram_i32 getattr spcmDll _spcm_dwGetParam_i32 12 spcm_dwGetParam_i32 argtype drv_handle int32 ptr32 spcm_dwGetParam_i32 restype uint32 load spcm_dwGetParam_i64 spcm_dwGetParam_i64 getattr spcmDll _spcm_dwGetParam_i64 12 spcm_dwGetParam_i64 argtype drv_handle int32 ptr64 spcm_dwGetParam_i64 restype uint32 load spcm_dwSetParam_i32 spcm_dwSetParam_i32 getattr spcmDll _spcm_dwSetParam_i32 12 spcm_dwSe...

Page 54: ...ed by the driver Examples Examples for Python can be found on CD in the directory examples python The directory contains the above mentioned header files and some examples each of them working with a certain type of card Please feel free to use these examples as a base for your programs and to modify them in any kind When allocating the buffer for DMA transfers use the following function to get a ...

Page 55: ...s will be found throughout this hardware manual when certain aspects of the driver usage are explained It is recommended to only use these constant names for better readability of the programs SpcmErrors java The SpcmErrors class contains all error codes that may be returned by the driver Examples Examples for Java can be found on CD in the directory examples java The directory contains the above ...

Page 56: ... LabVIEW manual for installation and useage of the LabVIEW drivers for this card MATLAB driver and examples A full set of drivers and examples is available for Mathworks MATLAB for Windows 32 bit and 64 bit versions and also for MATLAB for Linux 64 bit version There is no additional toolbox needed to run the MATLAB examples and drivers The MATLAB drivers have their own manual The MATLAB drivers ex...

Page 57: ... C C compiler for Windows or Linux Complete C C Example Register Value Direction Description SPC_M2CMD 100 w Command register of the board M2CMD_CARD_START 4h Starts the board with the current register settings M2CMD_CARD_STOP 40h Stops the board manually include c_header dlltyp h include c_header regs h include c_header spcm_drv h include stdio h int main drv_handle hDrv the handle of the device ...

Page 58: ...functionality will prevent the generation of unseen false commands and settings that may lead to totally unexpected behav ior For sure there are only errors locked that result on false commands or settings Any error code that is generated to report a condition to the user won t lock the driver As example the error code ERR_TIMEOUT showing that the a timeout in a wait function has occurred won t lo...

Page 59: ...er for more details on this function Card type The card type information returns the specific card type that is found under this device When using multiple cards in one system it is highly recommended to read out this register first to examine the ordering of cards Please don t rely on the card ordering as this is based on the BIOS the bus connections and the operating system One of the following ...

Page 60: ...I3024 33024h 208932 M2i 3013 TYP_M2I3013 33013h 208915 M2i 3025 TYP_M2I3025 33025h 208933 M2i 3014 TYP_M2I3014 33014h 208916 M2i 3026 TYP_M2I3026 33026h 208934 M2i 3015 TYP_M2I3015 33015h 208917 M2i 3027 TYP_M2I3027 33027h 208935 M2i 3016 TYP_M2I3016 33016h 208918 M2i 3031 TYP_M2I3031 33031h 208945 M2i 3020 TYP_M2I3020 33020h 208928 M2i 3032 TYP_M2I3033 33033h 208947 M2i 3021 TYP_M2I3021 33021h 20...

Page 61: ...stalled memory in bytes as a 64 bit integer value spcm_dwGetParam_i64 hDrv SPC_PCIMEMSIZE llInstMemsize printf Memory on card d MBytes n int32 llInstMemsize 1024 1024 printf d MSamples n int32 llInstMemsize 1024 1024 2 Register Value Direction Description SPC_PCIFEATURES 2120 read PCI feature register Holds the installed features and options as a bitfield The read value must be masked out with one...

Page 62: ...T 1h Is set if the firmware option Block Statistics is installed on the board which allows certain statistics to be on board calculated for data being recorded in segmented memory modes such as Multiple Recording or ABA SPCM_FEAT_EXTFW_SEGAVERAGE 2h Is set if the firmware option Block Average is installed on the board which allows on board hardware averaging of data being recorded in segmented mem...

Page 63: ...recommended that every custom written program performs a software reset first to be sure that the driver is in a defined state independent from possible previous setting Performing a board reset can be easily done by the related board command mentioned in the following table DRVTYP_WOW64 6 Windows WDM 64bit driver is used by 32bit application XP64 Vista Windows 7 Windows 8 Windows 10 DRVTYP_LINUX6...

Page 64: ... an error code ERR_VALUE To help user programs it is also possible to read out the number of activated channels that correspond to the currently programmed bitmap Reading out the channel enable information can be done directly after setting it or later like this Register Value Direction Description SPC_CHENABLE 11000 read write Sets the channel enable information for the next card run CHANNEL0 1 A...

Page 65: ... the above shown register The following example reads out the number of available input ranges and reads and prints the minimum and maximum value of all input ranges Activated channels bitmask is 0x00000003 Number of activated channels with this bitmask 2 Register Value Direction Description SPC_AMP0 30010 r w Defines the input range of channel0 SPC_AMP1 30110 r w Defines the input range of channe...

Page 66: ...ic type of board When writing a program that should run with different board families it is useful to just read out the possible offset than can be programmed You can use the following read only register to get the possible programmable offset range in percent To give you an example how the registers of the input range and the input offset are to be used the following example shows a setup to matc...

Page 67: ...er offset settings depends on the type of board you use The table below shows all the EEPROM sets that are available for your board If you want to make an offset adjustment on all the channels and store the data to the ADJ_USER0 set of the EEPROM you can do this the way the following example shows spcm_dwSetParam_i32 hDrv SPC_AMP0 1000 Set up channel0 to the range of 1 0 V spcm_dwSetParam_i32 hDrv...

Page 68: ...le SPCM_AI_SE 00000002h Input is single ended If available together with SPC_AI_DIFF or SPCM_AI_DIFFMUX input type is software selectable SPCM_AI_DIFF 00000004h Input is differential If available together with SPC_AI_SE input type is software selectable and switching from single ended to differential does not reduce the number of active channels by combining two single ended channels SPCM_AI_OFFSP...

Page 69: ...differences between them Acquisition modes Register Value Direction Description SPC_CARDMODE 9500 read write Defines the used operating mode a read command will return the currently used mode SPC_AVAILCARDMODES 9501 read Returns a bitmap with all available modes on your card The modes are listed below Mode Value Description SPC_REC_STD_SINGLE 1h Data acquisition to on board memory for one single t...

Page 70: ...rection Description SPC_M2CMD 100 write only Executes a command for the card or data transfer M2CMD_CARD_RESET 1h Performs a hard and software reset of the card as explained further above M2CMD_CARD_WRITESETUP 2h Writes the current setup to the card without starting the hardware This command may be useful if changing some internal settings like clock frequency and enabling outputs M2CMD_CARD_START...

Page 71: ...ng Either the trigger has been enabled together with the start command or the card now waits for trigger enable command M2CMD_CARD_ENABLETRIGGER After receiving this command the trigger engine is enabled and card checks for a trigger event As soon as the trigger event is received the status changes to M2STAT_CARD_TRIGGER and the card starts with the data replay After replay has been finished depen...

Page 72: ...ize which is defined by the PC hardware and the operating system There fore the notify size must be a multiple of 4 kByte For data transfer it may also be a fraction of 4k in the range of 16 32 64 128 256 512 1k or 2k No other values are allowed For ABA and timestamp the notify size can be 2k as a minimum If you need to work with ABA or timestamp data in smaller chunks please use the polling mode ...

Page 73: ... described in the chapter about the ABA mode option The ABA mode is only available on analog acquisition cards SPCM_BUF_TIMESTAMP 3000 Buffer is used to read out timestamp information Details on this mode are described in the chapter about the times tamp option The timestamp mode is only available on analog or digital acquisition cards Register Value Direction Description SPC_M2CMD 100 write only ...

Page 74: ...w many of them should be acquired after the trigger event has been detected You can access these settings by the register SPC_MEMSIZE which sets the total amount of data that is recorded and the register SPC_POSTTRIGGER that defines the number of samples to be recorded after the trigger event has been detected The size of the pretrigger results on the simple formula pretrigger memsize posttrigger ...

Page 75: ...e data acquisition setup with the read out of data afterwards To keep this example simple there is no error checking implemented Register Value Direction Description SPC_CARDMODE 9500 read write Defines the used operating mode a read command will return the currently used mode SPC_REC_FIFO_SINGLE 10h Continuous data acquisition to PC memory Complete on board memory is used as FIFO buffer Register ...

Page 76: ...E SPC_LOOPS Min Max Step Min Max Step Min Max Step Min Max Step Min Max Step 1 channel Standard Single 8 Mem 4 defined by post trigger 4 8G 4 4 not used not used Standard Multi ABA 8 Mem 4 4 8k 16 4 4 Mem 2 4 4 8 Mem 2 4 not used Standard Gate 8 Mem 4 4 8k 16 4 4 Mem 4 4 not used not used FIFO Single not used 4 8k 16 4 not used 8 8G 4 4 0 4G 1 1 FIFO Multi ABA not used 4 8k 16 4 4 8G 4 4 8 Mem 2 4...

Page 77: ... data until the complete on board memory is used Therefore a larger on board memory will make the transfer more reliable against any PC dead times As you see in the above picture data is directly transferred between application data buffer and on board memory Therefore it is abso lutely critical to delete the application data buffer without stopping any DMA transfers that are running actually It i...

Page 78: ... memory to keep the example simple In real world use it is recommended to set the notify size to a smaller stepsize Step 2 Start and first data available In between we have started the transfer and have waited for the first data to be available for the user When there is at least one block of notify size in the memory we get an interrupt and can proceed with the data Any data that already was tran...

Page 79: ... the available data section and the length vDoSomething pcData lBytesPos lAvailBytes the buffer section is now immediately set available for the card spcm_dwSetParam_i32 hDrv SPC_DATA_AVAIL_CARD_LEN lAvailBytes while dwError we loop forever if no error occurs char pcData new char lBufferSizeInBytes before starting transfer we ned to once fill complete buffer memory with data vDoGenerateData pcData...

Page 80: ...st be per formed before these values can be used as a signed two s complement value for above formulas Activated Channels Ch0 Ch1 Ch2 Ch3 Samples ordering in buffer memory starting with data offset zero 1 channel X A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 1 channel X B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B16 1 channel X C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13...

Page 81: ...Acquisition modes Data organisation c Spectrum GmbH 81 ...

Page 82: ... without divider optional This optional second Quartz2 is for special customer needs either for a special direct sampling clock or as a very precise reference for the PLL Please feel free to contact Spectrum for your special needs External reference clock PLL with external 1 MHz to 125 MHz reference clock This provides a very good clock accuracy if a stable external reference clock is used It also...

Page 83: ...e Direction Description SPC_AVAILCLOCKMODES 20201 read Bitmask in which all bits of the below mentioned clock modes are set if available SPC_CLOCKMODE 20200 read write Defines the used clock mode or reads out the actual selected one SPC_CM_INTPLL 1 Enables internal PLL with 10 MHz internal reference for sample clock generation SPC_CM_QUARTZ1 2 Enables Quartz1 for sample clock generation SPC_CM_QUA...

Page 84: ...t set a desired sampling rate with the SPC_SAMPLERATE register and to read it back The result will then again be the best matching sampling rate If a sampling rate is generated internally you can additionally enable the clock output The clock will be available on the external clock connector and can be used to synchronize external equipment with the board activated Channels M2i 3010 M2i 3011 M2i 3...

Page 85: ...e the driver and cannot be modified by the user The following register allows to read out the oversampling factor for further calculation The oversampling factor is of interest for three different cases When using clock output the sampling clock at the output connector is the real A D converter clock and not the programmed slower sam pling rate To calculate the output clock please just multiply th...

Page 86: ...ng introduction chapter Please be sure to select the correct external range as otherwise it is possible that the card will not run properly Register Value Direction Description SPC_CLOCKMODE 20200 read write Defines the used clock mode SPC_CM_EXTERNAL 8 Enables external clock input for direct sample clock generation Register Value Direction Description SPC_CLOCK50OHM 20120 read write A 1 enables t...

Page 87: ...of the clock that is fed in externally divided by the programmed clock divider The following table shows the available ranges when using external clocking The range must not be left by more than 5 when the board is running Remember that the ranges depend on the activated channels as well so a different board setup for external clocking must always include the related clock ranges This table below ...

Page 88: ...nd that most A D converters need a stable clock and there might be false samples inbetween directly after a gap or after a fast clock fre quency change The quality of the analog samples may also be worse than with a continuous clock Termination of the clock input If the external connector is used as an input either for feeding in an external reference clock or for external clocking you can enable ...

Page 89: ...efore Trigger Engine Overview To extend trigger facilities of the various trigger sources modes further on the trigger engine of the Spectrum M2i series allows the logical combi nation of different trigger events by an AND mask and an OR mask The Enable trigger allows the user to enable or dis able all trigger sources including channel trigger and external TTL trigger with a single software comman...

Page 90: ...SPC_TMASK_EXT0 2h Enables the external trigger0 for the OR mask The card will trigger when the programmed condition for this input is valid SPC_TMASK_EXT1 4h Enables the external trigger1 for the OR mask This input is only available on digital cards The card will trigger when the programmed condition for this input is valid SPC_TMASK_XIO0 100h Enables the extra TTL trigger 0 for the OR mask On pla...

Page 91: ...l trigger0 for the AND mask The card will trigger when the programmed condition for this input is valid SPC_TMASK_EXT1 4h Enables the external trigger1 for the AND mask This input is only available on digital cards The card will trigger when the programmed condition for this input is valid SPC_TMASK_XIO0 100h Enables the extra TTL trigger 0 for the AND mask On plain cards this input is only availa...

Page 92: ...le shows how to use the forcetrigger command It is also possible to enable arm or disable disarm the card s whole triggerengine by software By default the trigger engine is disabled The example shows how to arm and disarm the card s trigger engine properly Register Value Direction Description SPC_TRIG_ORMASK 40410 read write Defines the events included within the trigger OR mask of the card SPC_TM...

Page 93: ...igital boards this defines the TTL trigger mode for the trigger input of the first module Mod A SPC_TRIG_EXT1_MODE 40511 read write Defines the external TTL trigger mode for the trigger input of the second module digital boards only SPC_TRIG_XIO0_MODE 40560 read write Defines the trigger mode for the extra TTL input 0 On plain cards this input is only available if the option BaseXIO is installed A...

Page 94: ...els of an external TTL sig nal The board will trigger on the first HIGH level that is detected after starting the board If this condition is fulfilled when the board is started a trigger event will be detected The next triggerevent will then be detected if the actual record ing replay has finished and the board is armed and waiting for a trigger again Register Value Direction Description SPC_TRIG_...

Page 95: ...rd is armed and waiting for a trigger again Pulsewidth triggers TTL pulsewidth trigger for long HIGH pulses This mode is for detecting HIGH pulses of an external TTL signal that are longer than a programmed pulsewidth If the pulse is shorter than the programmed pulsewidth no trigger will be de tected The board will trigger on the first pulse matching the trig ger condition after starting the board...

Page 96: ...he following example shows how to setup the card for using external TTL pulse width trigger To find out what maximum pulsewidth in samples is available please read out the register shown in the table below Channel Trigger Overview of the channel trigger registers The channel trigger modes are the most commonly used ones similar to external equipment like oscilloscopes The huge variety of different...

Page 97: ...e edges SPC_TM_HIGH 00000008h Enables the trigger detection for HIGH levels SPC_TM_LOW 00000010h Enables the trigger detection for LOW levels SPC_TM_POS SPC_TM_REARM 01000001h Trigger detection for positive edges on lebel 0 Trigger is armed when crossing level 1 to avoid false trigger on noise SPC_TM_NEG SPC_TM_REARM 01000002h Trigger detection for negative edges on lebel 1 Trigger is armed when c...

Page 98: ... re turned value It is assumed that you know the actually selected input range Register Value Direction Description Range SPC_TRIG_CH0_LEVEL0 42200 read write Trigger level 0 channel 0 main trigger level upper level if 2 levels used 511 to 511 SPC_TRIG_CH1_LEVEL0 42201 read write Trigger level 0 channel 1 main trigger level upper level if 2 levels used 511 to 511 SPC_TRIG_CH2_LEVEL0 42202 read wri...

Page 99: ...annel 0 taken as example here Channel trigger on positive edge The analog input is continuously sampled with the selected sample rate If the programmed trigger level is crossed by the channel s signal from lower values to higher values ris ing edge then the triggerevent will be detected These edge triggered channel trigger modes correspond to the trigger possibilities of usual oscilloscopes Regist...

Page 100: ... engine is armed and waiting for trigger If the programmed trigger level is crossed by the channel s signal from lower values to higher values rising edge then the triggerevent will be detected and the trigger engine will be disarmed A new trigger event is only detected if the trigger engine is armed again The re arm trigger modes can be used to prevent the board from triggering on wrong edges in ...

Page 101: ...th the selected sample rate If the programmed trigger level is crossed by the channel s signal from higher to lower values falling edge the pulsewidth counter is started If the signal crosses the trigger level again in the opposite direction within the the programmed pulsewidth time no trigger will be detect ed If the pulsewidth counter reaches the programmed amount of samples without the signal c...

Page 102: ...ing signals The analog input is continuously sampled with the selected sample rate The upper and the lower level define a win dow Every time the signal enters the window from the out side a triggerevent will be detected Register Value Direction set to Value SPC_TRIG_CH0_MODE 40610 read write SPC_TM_POS SPC_TM_PW_SMALLER 02000001h SPC_TRIG_CH0_LEVEL0 42200 read write Set it to the desired trigger l...

Page 103: ...al is still outside the window the triggerevent will be detected Register Value Direction set to Value SPC_TRIG_CH0_MODE 40610 read write SPC_TM_WINLEAVE 00000040h SPC_TRIG_CH0_LEVEL0 42200 read write Set it to the upper trigger level relatively to the channel s input range board dependant SPC_TRIG_CH0_LEVEL1 42300 read write Set it to the lower trigger level relatively to the channel s input rang...

Page 104: ...will be detected If the pulsewidth counter reaches the programmed amount of samples a triggerevent will be detected Register Value Direction set to Value SPC_TRIG_CH0_MODE 40610 read write SPC_TM_WINENTER SPC_TM_PW_SMALLER 02000020h SPC_TRIG_CH0_LEVEL0 42200 read write Set it to the upper trigger level relatively to the channel s input range board dependant SPC_TRIG_CH0_LEVEL1 42300 read write Set...

Page 105: ...he lower level no trigger will be de tected If the signal does cross the lower level within the the pro grammed pulsewidth time a triggerevent will be detected Register Value Direction set to Value SPC_TRIG_CH0_MODE 40610 read write SPC_TM_STEEPNEG SPC_TM_PW_GREATER 04001000h SPC_TRIG_CH0_LEVEL0 42200 read write Set it to the upper trigger level relatively to the channel s input range board depend...

Page 106: ...imilar to the Multiple Recording in Standard Mode In contrast to the standard mode it is not nec essary to program the number of samples to be recorded The acquisition is running until the user stops it The data is read block by block by the driver as described under FIFO single mode example earlier in this manual These blocks are online available for further data process ing by the user program T...

Page 107: ...position of Timestamp Pretrigger The programming details of the timestamp option is explained in an extra chapter Activated Used Memory size Pre trigger Post trigger Segment size Loops Channels Mode SPC_MEMSIZE SPC_PRETRIGGER SPC_POSTTRIGGER SPC_SEGMENTSIZE SPC_LOOPS Min Max Step Min Max Step Min Max Step Min Max Step Min Max Step 1 channel Standard Single 8 Mem 4 defined by post trigger 4 8G 4 4 ...

Page 108: ...ck again to low level if the acquisition of this segment has been finished To give compatibility to older hardware and to give maxmimum flexibility there is a special register to change that behaviour Programming examples The following example shows how to set up the card for Multiple Recording in standard mode The following example shows how to set up the card for Multiple Recording in FIFO mode ...

Page 109: ...Gated Sampling in Standard Mode In contrast to the Standard Mode you cannot program a certain total amount of samples to be recorded but two other end conditions can be set instead The acquisition can either run until the user stops it by software infinite recording or until a programmed number of gates has been recorded The data is read continuously by the driver This data is online available for...

Page 110: ... that is available is at the time po sition of Timestamp1 Pretrigger The last sample of the gate segment is at the position Timestamp2 Posttrigger The length of the gate segment is Timestamp2 Timestamp1 Pretrigger Posttrigger When using the standard gate mode the end of recording is defined by the expiring memsize counter In standard gate mode there will be an additional timestamp for the last gat...

Page 111: ...on As this mode is purely level triggered the high level at the cards start time does trigger the board With the next low level the gate will be stopped Register Value Direction Description SPC_LONGTRIG_OUTPUT 200830 read write Defines the trigger pulse output as explained below 0 default The trigger pulse is generated on every trigger event and stays high until acquisition of segment has finished...

Page 112: ...LOW TTL level trigger This mode is for detecting the low levels of an external TTL signal The gate will start on low levels that are detected after starting the board As this mode is purely level triggered the low level at the cards start time does trigger the board With the next high level the gate will be stopped Register Value Direction Description SPC_TRIG_EXT0_MODE 40510 read write Sets the e...

Page 113: ...r starting the board As this mode is purely edge triggered the low level at the cards start time does not trigger the board The gate will stop on the second falling edge that is detected Register Value Direction Description SPC_TRIG_EXT0_MODE 40510 read write Sets the external trigger mode for the board SPC_TM_NEG SPC_TM_DOUBLEEDGE 08000002h Sets the gate mode for external TTL trigger to start and...

Page 114: ...OR mask SPC_TMASK_XIO0 100h Enable extra TTL input 0 for the OR mask On plain cards this input is only available if the option BaseXIO is installed As part of the digitizerNETBOX this input is available as connector Trigger B SPC_TMASK_XIO1 200h Enable extra TTL input 1 for the OR mask These trigger inputs are only available when option BaseXIO is installed Register Value Direction Description SPC...

Page 115: ...log input is continuously sampled with the selected sample rate If the programmed trigger level is crossed by the channel s signal higher values to lower values falling edge the gate starts When the signal crosses the programmed trigger from low er values to higher values rising edge then the gate will stop As this mode is purely edge triggered the low level at the cards start time does not trigge...

Page 116: ...ed from higher to lower values the trigger engine is armed and waiting for trigger If the programmed trigger level is crossed by the channel s signal from higher values to lower values falling edge then the gate starts and the trigger engine will be disarmed If the programmed trigger level is crossed by the channel s signal from lower values to higher values rising edge the gate stops A new trigge...

Page 117: ...rom lower to higher values rising edge the gate will stop The pulsewidth trigger modes for long pulses can be used to prevent the board from triggering on wrong short edges in noisy signals Channel window trigger for entering signals The analog input is continuously sampled with the selected sample rate The upper and the lower level define a win dow When the signal enters the window from the outsi...

Page 118: ... leaves the window from the inside to the outside the gate will start When the signal enters the window from the outside to the inside the gate will stop As this mode is level triggered the signal outside the win dow at the cards start time does trigger the board Register Value Direction set to Value SPC_TRIG_CH0_MODE 40610 read write SPC_TM_WINLEAVE 00000040h SPC_TRIG_CH0_LEVEL0 42200 read write ...

Page 119: ...RIG_CH0_LEVEL1 42300 read write Set it to the lower trigger level relatively to the channel s input range board dependant SPC_TRIG_CH0_PULSEWIDTH 44101 read write Sets the pulsewidth in samples Values from 2 to 65535 are allowed 2 to 65535 Register Value Direction set to Value SPC_TRIG_CH0_MODE 40610 read write SPC_TM_WINLEAVE SPC_TM_PW_GREATER 04000040h SPC_TRIG_CH0_LEVEL0 42200 read write Set it...

Page 120: ...it 16 to 23 minutes are placed in bit 8 to 15 seconds are placed in bit 0 to 7 SPC_TIMESTAMP_STARTDATE 47031 read write Return the reset date when using reference clock mode The year is placed in bit 16 to 31 the month is placed in bit 8 to 15 and the day of month is placed in bit 0 to 7 SPC_TIMESTAMP_TIMEOUT 47045 read write Sets a timeout in milliseconds for waiting of an reference clock edge SP...

Page 121: ...e by writing the TS_RESET commando to the command register After that command the counter counts continuously independent of start and stop of acquisition The timestamps of all recorded trigger events are referenced to this common zero time With this mode you can calculate the exact time difference between different recordings and also within one acqui sition if using Multiple Recording or Gated S...

Page 122: ...be installed on the card Otherwise there is no additional reference clock input available and this mode has no functionality If using a digitizerNETBOX this additional timestamp reference clock input is available as a standard and no option is needed to use this mode The counting is initialized with the timestamp reset command Both counter parts will then be set to zero The following table shows t...

Page 123: ...nsfer is performed with the same command and status registers like the card control and sample data transfer It is possible to send commands for card control data transfer and extra FIFO data transfer at the same time SPC_TSMODE_STANDARD 2h Standard mode counter is reset by explicit reset command SPC_TSMODE_STARTRESET 4h Counter is reset on every card start all timestamps are in relation to card s...

Page 124: ...rol will announce new data to the application by sending an event Waiting for an event is done internally inside the driver if the application calls one of the wait functions Waiting for an event does not consume any CPU time and is therefore highly requested if other threads do lot of calculation work However it is not necessary to use the wait functions and one can simply request the current sta...

Page 125: ...d Definition of the transfer buffer is similar to the above explained DMA buffer transfer The value notify size is ignored and should be set to 4k 4096 Buffer handling The buffer handling is also similar to the DMA transfer As soon as one of the registers SPC_TS_AVAIL_USER_LEN or SPC_ABA_AVAIL_USER_LEN is read the driver will read out all available data from the hardware and will return the number...

Page 126: ...RDTOPC 4096 void pcData 0 lBufSizeInBytes we start the polling mode dwError spcm_dwSetParam_i32 hDrv SPC_M2CMD M2CMD_EXTRA_POLL this is pur polling loop do spcm_dwGetParam_i32 hDrv SPC_TS_AVAIL_USER_LEN lAvailBytes spcm_dwGetParam_i32 hDrv SPC_TS_AVAIL_USER_POS lBytePos if lAvailBytes 0 printf We now have d new bytes available n lAvailBytes printf The available data starts at position d n lBytesPo...

Page 127: ... the acquired timestamps The example doesn t care for the acquired data itself and doesn t check for error Register Value Direction Description SPC_TIMESTAMP_CMD 47100 r w SPC_TSXIOACQ_ENABLE 4096 Enables the trigger synchronous acquisition of the BaseXIO inputs with every stored timestamp in the upper byte SPC_TSXIOACQ_DISABLE 0 The timestamp is filled up with leading zeros as a sign extension fo...

Page 128: ...igger The first A area sample is related to the card start and therefore in a fixed but various settings dependant relation to the timestamped B sample To bring exact relation between the first A area sample and therefore all area A samples and the B area samples it is possible to let the card stamp the first A area sample automatically after the card start The following table shows the register t...

Page 129: ...his mode The programming details of the ABA mode and timestamp modes are each explained in a dedicated chapter in this manual SPC_TSFEAT_MASK F0000h Mask for the feature relating bits of the SPC_TIMESTAMP_CMD bitmask SPC_TSFEAT_STORE1STABA 10000h Enables storage of one additional timestamp for the first A area sample B time base related in addition to the trigger related timestamps SPC_TSFEAT_NONE...

Page 130: ...cond clock base As explained above the acquisition is not changing the sampling clock but runs the slower ac quisition with a divided clock The ABA memory setup including the divider value can be programmed with the following registers The resulting ABA clock is then calculated by sampling rate ABA divider Each segment can consist of pretrigger and or posttrigger samples The user always has to set...

Page 131: ...t ABA mode Register Value Direction Description SPC_MEMSIZE 10000 read write Defines the total number of samples to be recorded per channel Register Value Direction Description SPC_CARDMODE 9500 read write Defines the used operating mode SPC_REC_FIFO_ABA 80h Continuous data acquisition for multiple trigger events together with continuous data acquisition with a slower sam pling clock Register Valu...

Page 132: ...t is similar for both kinds of data transfer is the handling of the DMA engine This is similar to the main sample data transfer engine Therefore additional information can be found in the chapter explaining the main data transfer Commands and Status information for extra transfer buffers As explained above the data transfer is performed with the same command and status registers like the card cont...

Page 133: ... will announce new data to the application by sending an event Waiting for an event is done internally inside the driver if the application calls one of the wait functions Waiting for an event does not consume any CPU time and is therefore highly requested if other threads do lot of calculation work However it is not necessary to use the wait functions and one can simply request the current status...

Page 134: ...s executed Definition of the transfer buffer is similar to the above explained DMA buffer transfer The value notify size is ignored and should be set to 4k 4096 Buffer handling The buffer handling is also similar to the DMA transfer As soon as one of the registers SPC_TS_AVAIL_USER_LEN or SPC_ABA_AVAIL_USER_LEN is read the driver will read out all available data from the hardware and will return t...

Page 135: ...w have d new bytes available n lAvailBytes printf The available data starts at position d n lBytesPos we take care not to go across the end of the buffer if lBytePos lAvailBytes lBufSizeInBytes lAvailBytes lBufSizeInBytes lBytePos our do function get s a pointer to the start of the available data section and the length vProcessTimestamps pcData lBytesPos lAvailBytes the buffer section is now immed...

Page 136: ...n V2 06 or newer and firmware version V16 or newer M3i driver version V2 06 or newer and firmware version V6 or newer Please update your system to the newest versions to run this mode The programming details of the ABA mode and timestamp modes are each explained in a dedicated chapter in this manual normal timestamp setup e g setting timestamp mode to standard using internal clocking uint32 dwTime...

Page 137: ... the lines from outside the system to easily connect with external equipment The internal connectors are mounted on two locations on the base card The picture below shows the location of the MMCX connectors on the card the details of the connectors on the extra bracket are shown in the introductional part of this manual Different functions Asynchronous Digital I O This way of operating the option ...

Page 138: ...ming Example The following example shows how to program the lower group to be input and the upper group to be output and how to write and read and interpret mask the digital data Special Sampling Feature When using the option BaseXIO in combination with the timestamp mode one can enable a special auto sampling option that samples the eight BaseXIO lines synchronously with each trigger event This f...

Page 139: ...ery exact way like a star hub that is installed on a plug in card Star Hub trigger engine The trigger bus between an M2i card and the Star Hub option con sists of three lines Two of them send the trigger information from the card s trigger engine to the Star Hub and one line receives the resulting trigger from the Star Hub While the returned trigger is iden tical for all synchronized cards the sen...

Page 140: ...ne system Each set of cards connected by a Star Hub then runs totally independent It is also possible to mix cards that are connected with the Star Hub with other cards that run independent in one system Star Hub Initialization The interconnection between the Star Hubs is probed at driver load time and does not need to be programmed separately Instead the cards can be accessed using a logical inde...

Page 141: ...0 spcm_vClose hSync for i 0 i 2 i spcm_vClose hCard i Register Value Direction Description SPC_SYNC_READ_SYNCCOUNT 48990 read Number of cards that are connected to this Star Hub SPC_SYNC_READ_CARDIDX0 49000 read Index of card that is connected to star hub logical index 0 mask 0x0001 SPC_SYNC_READ_CARDIDX1 49001 read Index of card that is connected to star hub logical index 1 mask 0x0002 read SPC_S...

Page 142: ...sired sampling rate to this card The synchronization will automatically calculate the matching divider and set up all details internally for j 0 j lStarhubCount j spcm_dwGetParam_i32 hSync j SPC_SYNC_READ_SYNCCOUNT lSyncCount for i 0 i lSyncCount i spcm_dwGetParam_i32 hSync j SPC_SYNC_READ_CARDIDX0 i lCardIdx printf star hub c logical index d is connected with card d n j A B i lCardIdx printf n st...

Page 143: ... hCard 0 SPC_TRIG_ORMASK SPC_TMASK_EXT0 spcm_dwSetParam_i32 hCard 0 SPC_TRIG_EXT0_MODE SPC_TM_POS spcm_dwSetParam_i32 hCard 1 SPC_TRIG_ORMASK SPC_TM_NONE spcm_dwSetParam_i32 hCard 2 SPC_TRIG_ORMASK SPC_TM_NONE spcm_dwSetParam_i32 hCard 3 SPC_TRIG_ORMASK SPC_TM_NONE for i 0 i lSyncCount i int32 lAllChannels SPC_TMASK0_CH0 SPC_TMASK0_CH1 SPC_TMASK_CH2 SPC_TMASK_CH3 spcm_dwSetParam_i32 hCard i SPC_TR...

Page 144: ...nt of the synchronized card The mode is by example useful if one has one or more output cards that run con tinuously in a loop and are synchronized with star hub and in addition to this one or more acquisition cards should make multiple acquisitions but using the same clock For all M2i cards is is also possible to run the slave cards with a divided clock Therefore please program a desired divided ...

Page 145: ...CM_SHDIRECT 128 Uses the clock from the star hub as if this was an external clock setup of the generator card spcm_dwSetParam_i32 hCard 0 SPC_CARDMODE SPC_REP_STD_SINGLE spcm_dwSetParam_i32 hCard 0 SPC_LOOPS 0 infinite data replay spcm_dwSetParam_i32 hCard 0 SPC_CLOCKMODE SPC_CM_INTPLL spcm_dwSetParam_i32 hCard 0 SPC_SAMPLERATE MEGA 1 spcm_dwSetParam_i32 hCard 0 SPC_TRIG_ORMASK SPC_TM_SOFTWARE spc...

Page 146: ...connecting all the cards within same master PC system including the carrier card itself The master system piggy back module is equipped with four MMCX connectors to input and output clock and trigger information Additionally a clock and trigger distribution card either PCI or PCI Express must be in stalled that takes the clock and trigger infor mation from the Star Hub piggy back module and create...

Page 147: ...nnection does not differ from setting up a Star Hub system without the system synchro nization feature Connecting the systems All systems to be synchronized must be connected to the clock and trigger distribution card that is mounted within the master system The distribution card provides up to 17 copies of the trig ger and clock signal coming from the master For each slave sys tem and also for lo...

Page 148: ...ystem Star Hub distribution consists of two 1to17 low jitter low skew buffers to generate the copies routed to all slave systems and the master itself These buffers generate a certain delay caused by the propagation delay of the buffers Additionally also all cables involved add a certain delay When not only using clock synchronization but also wanting the triggers on all slaves also to be synchron...

Page 149: ...on affects all cards connected to a Star Hub this register is written to the Star Hub handle itself instead to the single cards Programming example To show the required steps when programming the system Star Hub you ll find a stripped down simplified example on the included driver CD This C example is also available from the Spectrum homepage For simplicity this rec_std_system_sync example assumes...

Page 150: ...lities when using interlace mode If you use the option digital inputs in combination with the interlace mode see standard mode data organization section for details digital samples of the internally connected channels channel 0 and channel 1 on a M2i 30x5 or channel 0 and channel 2 on a M2i 30x6 are sampled alternately with half of the sampling rate To get four digital bits sampled with the full s...

Page 151: ...ixed delay between the analog and digital samples The delay for your type of board can be found in the technical data section Electrical specifications The electrical specifications of the digital inputs option can be found either in the technical data section of this manual or in the datasheet ...

Page 152: ...ad data as 16 bit integer values If digital inputs are activated these digital inputs are stored in the four upper bits of the 16 bit data word Digital differential mode The digital differential mode samples the input with two 12 bit converters each one for the true and the complementary input phase and does the subtraction in the digital domain Therefore the result is a 13 bit digital twos comple...

Page 153: ...ithout the differential feature installed The trigger modes for the TTL trigger inputs remain the same compared to cards without installed digital differential feature Programming The digital differential mode can be enabled seperately for every installed module by the following registers Enabling the digital differential mode either on one or on both modules will allow the card to work in one of ...

Page 154: ...fferential feature For details clock generation and limits please see the relating passage in this manual Example The following example show the necessary driver calls to enable the digital differential modes for card with two installed differential channels spcm_dwSetParam_i32 hDrv SPC_CHENABLE CHANNEL0 CHANNEL2 spcm_dwSetParam_i32 hDrv SPC_DIFF0 1 enable digital differential mode on channel0 spc...

Page 155: ...entry in the Folder Spectrum GmbH to start the Remote Server To start the Remote Server automatically after login just copy this shortcut to the Autostart directory Linux Linux users find the versions of the installer for the different StdC libraries under under Install linux spcm_control_center as RPM packages To start the Remote Server type spcm_remote_server without quotation marks To start the...

Page 156: ...ing steps Ask your network administrator for the IP address of the digitizerNETBOX generatorNETBOX and access it directly over the IP address Check your local firewall whether it allows access to the device and whether it allows to access the ports listed in the technical data sec tion Check with your network administrator whether the subnet the device and the ports that are listed in the technica...

Page 157: ...es of code to be changed compared to using local cards Instead of opening two locally installed cards like this one would call spcm_hOpen with a VISA string as a parameter instead to open cards on the Remote Server PC with the IP address 192 168 1 2 The driver will take care of all the network communication hDrv0 spcm_hOpen dev spcm0 open local card spcm0 hDrv1 spcm_hOpen dev spcm1 open local card...

Page 158: ...t s not installed ERR_SEQUENCE 103h 259 Command sequence is not allowed Please check the manual carefully to see which command sequences are possible ERR_READABORT 104h 260 Data read is not allowed after aborting the data acquisition ERR_NOACCESS 105h 261 Access to this register is denied This register is not accessible for users ERR_TIMEOUT 107h 263 A timeout occurred while waiting for an interru...

Page 159: ...n board EEProm This could be a critical hardware failure Please restart the system and check the PCI connector ERR_CARDNOSUPPORT 207h 519 The card that has been found in the system seems to be a valid Spectrum card of a type that is supported by the driver but the driver did not find this special type internally Please get the latest driver from www spectrum instrumentation com and install this on...

Page 160: ... All translation and set up of the Scatter Gather list is done inside the driver without being seen by the user Although the Scatter Gather DMA transfer is an advanced and powerful technology it has one disadvantage For each transferred memory page of data it is necessary to also load one Scatter Gather entry which is 16 bytes on 32 bit systems and 32 bytes on 64 bit systems The little overhead to...

Page 161: ...ated was 384 MByte of continuous buffer on a system with 4 GByte memory installed PCI 33 MHz slot PCI X 66 MHz slot PCI Express x1 slot Mode read write read write read write User buffer 109 MB s 107 MB s 195 MB s 190 MB s 130 MB s 138 MB s Continuous kernel buffer 125 MB s 122 MB s 248 MB s 238 MB s 160 MB s 170 MB s Speed advantage 15 14 27 25 24 23 Notifysize 16 kByte Notifysize 64 kByte Notifys...

Page 162: ...lue is an error code drv_handle hDevice handle to an already opened device uint32 dwBufType type of the buffer to read as listed above under SPCM_BUF_XXXX void ppvDataBuffer address of available data buffer uint32 pdwContBufLenH high part of length of available continuous buffer uint32 pdwContBufLenL low part of length of available continuous buffer int32 lMemsize 16384 recording length is set to ...

Page 163: ...ts of the following analog channels A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 D0 GND D1 GND D2 GND D3 GND D4 GND D5 GND D6 GND D7 GND n c n c n c n c B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B16 B17 B18 B19 B20 n c n c n c n c n c n c n c n c n c n c n c n c n c n c n c n c n c n c n c n c A21 A22 A23 A24 A25 A26 A27 A28 A29 A30 A31 A32 A33 A34 A35 A36 A37 A3...

Page 164: ...otprint as well as the PCB top footprint are shown here Please note that the PCB footprint is given as top view The following table shows the relation between the card connector pin and the IDC pin t IDC footprint pin Card connector pin Card connector pin IDC footprint pin 1 A1 A21 A41 A61 B1 B21 B41 or B61 A2 A22 A42 A62 B2 B22 B42 or B62 2 3 A3 A23 A43 A63 B3 B23 B43 or B63 A4 A24 A44 A64 B4 B24...

Page 165: ...rformance clock or trigger source with the card s clock or trigger inputs with logic high levels above the clamping voltage please make sure to not exceed the current limit of the clamping di odes This can most easily be ensured when using the card s 50 Ohm termination and a series resistor of 33 Ohm up to 47 Ohm on the clock or trigger source To avoid floating levels with unconnected inputs a pul...

Reviews: