The 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:
- C/C++
- Gnu C++
- Visual Basic
- VB.NET, C#
- Delphi
- Java
- Python
- Julia
- LabWindows/CVI
- IVI
- LabVIEW
- MATLAB
Programming Example
Programming the cards is easily 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);
spcm_dwSetParam_i32 (hCard, SPC_M2CMD, M2CMD_CARD_START | M2CMD_CARD_ENABLETRIGGER);
spcm_dwSetParam_i32 (hCard, SPC_M2CMD, M2CMD_DATA_STARTDMA | M2CMD_DATA_WAITDMA);
// ... do something with the acquired data and close
spcm_vClose (hCard);
Downloads
- M2p/M2i/M3i/M4i/M4x/M5i/DN2/DN6 Examples Installer
- MI/MC/MX Examples Installer
- All Downloads