API

< g.MOBIlab < Data acquisition < Products < Home 
 

 

Application programming interface for g.MOBIlab on Pocket PC or Notebook/PC

What is Programming API for g.MOBIlab ?

The Application Programming Interface (API) for g.MOBIlab enables you to program your own sophisticated biosignal acquisition and data processing applications based on the g.MOBIlab amplifier on a Pocket PC and Windows based PC/Notebook.

Sample programs and the well documented source code in the electronic manual serve as a template for your programs. The Application Programming Interface for g.MOBIlab optimally supports your own development of mobile biosignal data processing programs. Debugging the programs directly on the Pocket PC or using the built-in emulator enables you to accelerate the development process.

The g.MOBIlab API allows you to setup the communication with the g.MOBIlab amplifier, to initialize the amplifier, to start and stop the data acquisition, to set and reset digital I/O lines and to store data on the Pocket PC.

Using emMbedded Visual C++ or eMbedded Visual Basic development environment you can create and program Windows Mobile applications relaying on user friendly graphical user interfaces.

Using Visual C++ (Borland Compiler/Microsoft Compiler supported) PC based environment you can create and program laboratory applications relying on your preferred development tools.

Example 1: Acquiring biosignal data with g.MOBIlab

In the first example the data for one biosignal channel are acquired. The values are stored in a file called demo.txt. A thread called ThreadProc is created and started. This thread reads data from the serial port and stores it to the file demo.txt in ASCII format. The data can then be viewed using g.BSanalyze or simply e.g. in Microsoft Excel. In this example ECG data from channel 5 were acquired and stored on the Pocket PC.

void CTestapplDlg::OnbStartRead()
{

// Starts the acquisition on g.MOBIlab
// the worker thread is created
// file demo.txt is created to hold acquired data

BOOL ret = FALSE;
GetDlgItem( IDC_Read )->EnableWindow(FALSE);

if(hDev == NULL)
{
  MessageBox (L"No valid Handle",L"WARNING" ,MB_OK |
  MB_ICONWARNING);
  GetDlgItem( IDC_Read )->EnableWindow(TRUE);
  return;
}

// create worker thread
hThread=CreateThread (NULL, 0,ThreadProc , this ,
                     CREATE_SUSPENDED,&_tid);
if (hThread == NULL)
{
 MessageBox(L"Could not create thread",L"ERROR",MB_OK |
 MB_ICONERROR);
 GetDlgItem( IDC_Read )->EnableWindow(TRUE);
 return;
}

// create storage file demo.txt
fid = fopen("demo.txt", "w" );

_isrunning = TRUE;
StartAcquisition(hDev); // start g.MOBIlab
ResumeThread(hThread); // start worker thread

return;

}

Example 2: Setting the Digital I/O

In the following example a red and green light is switched on and off via 2 digital lines. If you press the button "Red_Led" in the g.MOBIlab demo example then the following code sequence is processed:

void CTestapplDlg::OnbSetGreenLed()
{
 

// Set the green led on and the red led off
// on the paradigma led box

BOOL ret = FALSE;
ret = SetDigitalOut(hDev,1,1); // set green led on

if(!ret)
{
  ErrorHandling();
  return;
}

ret = SetDigitalOut(hDev,2,0); // set red led off
if(!ret)
{
  ErrorHandling();
  return;
}

}

Highlights

  • program your own EEG, ECG, EMG, EOG data recording system on a Pocket PC and Notebook/desktop PC
  • include your own sophisticated data processing algorithms and add your customized functionality to g.MOBIlab
  • send the acquired raw data or preprocessed biosignals with GSM or WLAN
  • debug your application directly on the Pocket PC and Notebook/desktop PC connected to g.MOBIlab amplifier

Package includes

  • device driver API for g.MOBIlab
  • electronic handbook
  • sample code and tutorial

Prerequisites

  • g.MOBIlab mobile biosignal data acquisition package
  • Microsoft eMbedded Visual C++ / Visual C++ development environment for PC

Copyright © g.tec

 

API • BCI

Copyright © 2007

Cortech Solutions

Updated: 12-Jul-2007

Note that our products are not designed for medical use in diagnosis or treatment of disease. We sell scientific equipment to research scientists working in a variety of fields, but we do not offer any products for, nor do we intend for any of our research products to be used for, diagnosis or treatment of disease. Contact us with questions or comments about this web site.