ProductsApplicationsSupportNewsEventsCompanyContact Us

C API - g.USBamp


Device Driver for g.USBamp

g.USBamp C API imageThe Device Driver for g.USBamp is an Application Programming Interface (API) that allows to access the amplifier from many programming environments. The API has functions to fully control the amplifier from C, C++, Visual Basic, LabWindows and many more programming languages.
The Device Driver gives access to the data which is sent over USB to the computer. Bandpass and Notch filter settings can be performed, the sampling frequency can be selected, a test signal can be applied and the amplifier can be calibrated controlled by your own program. Bipolar derivations can be made between two electrodes.
Multiple g.USBamps can be used if they are connected to the synchronization cable to work absolute in synchrony. Therefore one device must be defined as MASTER to control the other amplifiers.
An integrated impedance check gives you the impedance values of all electrodes connected to the 16 input channels and 4 reference channels.
The Device Driver package contains demo programs that show you the usage of all functions and help to get started with the API.

Highlights

  • Acquire EEG, ECoG, ECG, EMG, EOG data in your own programs   
  • Control g.USBamp from C, C++, LabWindow, Visual Basic or other programming languages   
  • Develop stand-alone programs for biosginal analysis   
  • Build your own multi-channel biosignal acquisition with multiple g.USBamps   

On-line Data Acquisition

The demo program allows to test all functions of the amplifier and the documented source code shows the usage of the API. First the USB port where the amplifier is connected must be defined. Then a connection to the device is established and after sending a Start command the data can already be acquired.
g.USBamp demo application
Another demo program introduces the usage of multiple g.USBamps to form e.g. a 32 channel system.

Programming with the API

The API contains commands to access all functions of the amplifier. First a handle m_hdev to the amplifier is assigned.
GT_SetBufferSize allows to define the buffer size to specify the amount of scans sent at once to the PC:
GT_SetBufferSize(m_hdev,BUFFERLENGTH);

The definition of the sampling rate is done with the following command:
GT_SetSampleRate(m_hdev,128);
Then the operation mode of the amplifier is set to NORMAL. This means that biosignal data is sampled and sent to the PC. Other modes would be CALIBRATION or IMPEDANCE check.
GT_SetMode(m_hdev,M_NORMAL);
Finally GT_GetData is used to read out the biosignal data from the amplifier:
GT_GetData(pthis->m_hdev, pBuffer,HEADER_SIZE + bufLen,&ov);