Sie sind hier

C/C#/C++, .NET, Python, Java Examples | Spectrum

Spectrum Driver ExamplesThe Spectrum standard API allows the access from various programming languages. The complete API is simple to use yet powerful in the functionality. All programming is done using software registers therefore only a handful of functions is needed. Including the API into a programming environment is a simple task.

Available Examples

Included in the delivery are examples fir different measurement tasks for different programming environments. A huge number of setups is supported as a standard. This gives an easy and fast start with the porgramming:

Programming Example

Programming the cards is easy done with a few functions and comfortable software registers:

hCard = spcm_hOpen ("/dev/spcm0");

// setup 1 channel, single acquisition, softwaretrigger, 20 MHz clock
spcm_dwSetParam_i32 (hCard, SPC_CHENABLE, 1);
spcm_dwSetParam_i32 (hCard, SPC_CARDMODE, SPC_REC_STD_SINGLE);
spcm_dwSetParam_i32 (hCard, SPC_TRIG_ORMASK, SPC_TMASK_SOFTWARE);
spcm_dwSetParam_i32 (hCard, SPC_CLOCKMODE, SPC_CM_INTPLL);
spcm_dwSetParam_i32 (hCard, SPC_SAMPLERATE, MEGA(20));

// setup transfer and start and wait for acquisition and data transfer
spcm_dwDefTransfer_i64 (hCard, SPCM_BUF_DATA, SPCM_DIR_CARDTOPC, lNotifySize, pnData, 0, lBufferSize);

// ... do something with the acquired data and close
spcm_vClose (hCard);