LXDeviceAPI

LXDeviceAPI

 

LOGO LXDevice API API for bio signal measuring devices

version : 1.0.4.0 ( Release Date : 2017-04-20 )

The devices can be communicated with your application program via LXDeviceAPI. You can make your own application programs for communicating with devices. LXDeviceAPI provides the standard C libraries and messages.

System Architecture LXDeviceAPI

System Architecture LXDeviceAPI

Features

  • Real time bio signal data streaming from measuring device to your application program.
  • Extremely stable and reliable thread for real time streaming data.
  • Setting the device parameters (Sampling Frequency, Device Mode Change)
  • Providing the self contained UI.
    • Setting the signal filter(LPF, HPF, notch) via “device control panel”.
    • Electrode-Skin Impedance Monitoring.
    • Auto Calibrating the device.
    • Auto Self Updating API.
    • Auto Device Firmware Update.
    • Saving the configuration information into Device.
  • API type : DLL (Dynamic Link Library).
  • API Making tool : Visual C++ 2015. MFC Regular DLL project.
  • Supporting platform : both 32bit and 64bit.
  • Supprting OS : Windows 10,  8.1, 8, 7.
  • Recommended IDE for developing the application program : Visual Studio Communitity 2015. Visual C++ . It’s free !.

 

Supporting Devices

  • QEEG-64FX.
    • Utra High Precision,
    • Available Channel Options from 8ch to 64ch.
      • 8ch, 16ch, 24ch, 32ch, 40ch, 48ch, 56ch, 64ch.
  • QEEG-32FX.
    • Ultra High Precision.
    • Max 32channel (fixed) EEG.

 

 

Getting Started.

 

step1. Download / Unblock / Unzip LXDeviceAPI

step1.1 Download

Click LXDeviceAPI_32bit.zip if your application program is 32bit(x86) or LXDeviceAPI_64bit if your application program is 64bit(x64), download to your PC.

step1.2 Unblock the zip file

Before unzip, unblock the zip file should be taken. Click the downloaded  zip file by right mouse and click the Properties (red box following left image). Check Unblock and then click OK.

Unblock Zip file Unblock Zip file

step1.3 Unzip

After unzip, you can see the files and folder as following.

LXDeviceAPI files & folder

LXDeviceAPI files & folder

 

step2. Copy files to your project folder

files  copy to 
  • LXDeviceAPI_Utility (folder)
  • chartdir60.dll
  • LXDeviceAPI.dll
copy to the same folder which contains your application exe file.
  • LXDeviceAPI.h
  • LXDeviceAPI.lib
copy to your application project’s source folder.

 

step3. Importing DLL

In your Visual C++ source file, add the codes for implicit linking the library and include the LXDeviceAPI.h

#pragma comment(lib,"LXDeviceAPI.lib") // DLL implicit linking

#include "LXDeviceAPI.h"

That’s all, now it’s ready to use all functions and message from LXDeviceAPI.

 

API Stream Data

struct : ST_STREAMDATA_LXDAPI

LXDeviceAPI.h provides the typedef of ST_STREAMDATA_LXDAPI.

// struct for stream. LXDeviceAPI.h

typedef struct _stStreamData_LXDAPI
{
...
  unsigned int*	Event_StreamData_CS; // array for event marking

  double*	Wave_StreamData_CS;  // array for measured multi channel bio signal
...


}ST_STREAMDATA_LXDAPI;

The most important member variables are  Wave_StreamData_CS for multi channel bio signal and Event_StreamData_CS for event marking.

Usages

Declare the variable for stream data type and feed into OpenDevice as a address of variable.

ST_STREAMDATA_LXDAPI stStreamData; 
int NumSampleReturn = 32 ; //available range 1~ 128. the number of samples to get the stream data per each message from LXDeviceAPI. 
OpenDevice_LXDeviceAPI( , &stStreamData,NumSampleReturn , );

Dynamic Memory Allocation by LXDeviceAPI

LXDeviceAPI dynamic allocates the memory for arrays when you call the OpenDevice. The size of memory is determined by the OpenDevice’s parameter int numsample_return  which is the number of samples per each message  received.  LXDeviceAPI deletes the memory if CloseDevice is called.

Memory Map, Array Indexing.

The array Wave_StreamData_CS has real time measured sampling data from the device.

The number of samples is determined by a parameter  int numsample_return when you call the OpenDevice.

Wave Stream Data LXDeviceAPI

 

The Event_StreamData_CS has a value of “event id” which is the same as a parameter unsigned int event_id when you call the EventMarkingOnStream. The number of samples is the same as that of Wave_StreamData_CS.

Event Stream Data LXDeviceAPI

Retrieving the one sample from Stream Array

Array indexing for wave data

The following code shows how to get the one sample for specific channel index and sample index,

double one_sample_wave = stStreamData.Wave_StreamData_CS[sample_index + NumSampleReturn * channel_index ]

where,

  • channel_index  : Available value range form 0 to ( number of channel   – 1). The number of channel is specific to device. In the case of  QEEG-64FX, the number of channel is 67 ( EEG 64ch + Bipolar 3ch).
  • sample_index : Available value range from  0 to (NumSampleReturn – 1). The NumSampleReturn is determined by the parameter int numsample_return when you call the OpenDevice.

Array indexing for event data.

unsigned int one_sample_event = stStreamData.Event_StreamData_CS[ sample_index ]

where,

  • sample_index : Available value range from  0 to (NumSampleReturn- 1).The NumSampleReturn is determined by the parameter int numsample_return when you call the OpenDevice.

 

Indexing Example

Array indexing example for two channel signals and event. The chart plots the both signals and event simultaneously.

Stream Data Array Indexing Example

Stream Data Array Indexing Example

API Messages

Messages by LXDeviceAPI.

LXDeviceAPI send mesage to application program using win32 function SendMessage(.,.,wParam, lParam) . The message parameter wParam has informations to recognize the message type and what processing should be taken by application program.

Message Parameter – wParam

LXDeviceAPI send a wParam as an unsigned int type(byte size 4). Application program can take the information at each byte as follows;

wParam is divided into 4 bytes. Byte0 is lowest byte and Byte3 means highest byte.

Parameter  Written data Description
 wParam_Byte3  Device Handling ID.
  • Device Handling ID =  wParam_Byte3*256 +  wParam_Byte2. range : 1~65535
  • The message is sent by device correspond to “Device Handling ID”.
  • Related : Device Handling ID  can be retrived by return value of OpenDevice.
 wParam_Byte2
 wParam_Byte1  Message Type ID.
  • Identificating the message.
  • available values : MSGTYPEID#_DEVICE_LXDAPI, MSGTYPEID#_API_LXDAPI predefined on LXDeviceAPI.h.
  • Related Function : SetMessageDevice
wParam_Byte0  Message Type Sub ID.
  •  sub message type under Message Type ID.

Message Type vs. Meaning.

 Message Type ID  Message Type Sub ID  Meaning.
 MSGTYPEID0_DEVICE_LXDAPI  0 The number of sampling data is ready. App’s message handler must call the function GetStreamData to get the stream data from LXDeviceAPI. The “number of sampling” is defined by int numsample_return when calling the function OpenDevice.

Code Example1. function SetMessageDevice

#define WM_STREAM_DEVICE  WM_USER+203 // You must define the message without duplication with any other messages in your program.

void CLXDeviceAPI_Sample1View::OnMenuSetmessagedevice()
{
  // Mandatory for receiving the stream data from LXDeviceAPI.
  SetMessageDevice_LXDeviceAPI(m_iDeviceHandlingID, MSGTYPEID0_DEVICE_LXDAPI, this->m_hWnd, WM_STREAM_DEVICE,1); 
}

Code Example2. function StartStream

void CLXDeviceAPI_Sample1View::OnMenuStartstream()
{
  StartStream_LXDeviceAPI(m_iDeviceHandlingID);
}

Code Example3. Message Handler

After calling the function StartStream, the LXDeviceAPI sends a message when the number of sample data is ready. Your app’s message handler must call the function GetStreamData to get the stream data from LXDeviceAPI. The “number of sampling” is defined by int numsample_return when calling the function OpenDevice. If you stop the message from LXDeviceAPI, call the function StopStream or call the SetMessageDevice as last parameter = 0.

afx_msg LRESULT CLXDeviceAPI_Sample1View::OnStreamData(WPARAM wParam, LPARAM lParam)
{
 unsigned int uintWPARAM = (unsigned int)wParam; 
 unsigned char msgtype_id = (unsigned char)(uintWPARAM >> 8)  ; //get the lowest 2'nd byte(message type id).
 unsigned char msgtype_subid = (unsigned char)(uintWPARAM); //get the lowest 1st byte(message type sub id).

 switch (msgtype_id)
 {
 case MSGTYPEID0_DEVICE_LXDAPI: // for real time stream type messages. 

  switch (msgtype_subid)
  {
  case 0:

   GetStreamData_LXDeviceAPI(uintWPARAM); 


   // After call GetStreamData, the new stream data is allocated on ST_STREAMDATA_LXDAPI variable.
   // use stream data here. plotting, saving, calculating, etc. 

   break;

  } // switch (msgtype_subid)

  break;  // case MSGTYPEID0_DEVICE_LXDAPI: // for real time stream type messages. 
 }// switch (msgtype_id)


 return 0;
}

 

API Functions

 

Function Call Sequence LXDeviceAPI

Function Call Sequence LXDeviceAPI

 

 

 

 

 

 

 

 

 

 

 

 

 

OpenApi

Definition

 

int OpenApi_LXDeviceAPI(int api_window, int api_selfupdate, int mode)

Parameters

Parameter Available Value Description
 int api_window
  •  0 : “api window” view off.
  •  1 : “api window” view on.(default)
api window view enable/disable.
 int api_selfupdate
  • 0 : “api check self update” execution.
  • 1 ; “api check self update” no exec.(default)
api self-upadte check execution or not.
 int mode
  •  0: (default)
 reserved.

Return Values

Return  meaning Description
 1  Success
 -1  Fail.
 -2  Fail. Duplicated Call  Already succefully called OpenApi.
 -5  Fail. During window registry fixing.  Windows 8/10. LXDeviceAPI fixing the os registry for USB normal communication.
-101 ~ -120  Fail. Internal DLL loading error. When OpenApi called, LXDeviceAPI loading the internal used DLL from the folder LXDeviceAPI_Utility.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuOpenapi()
{
  OpenApi_LXDeviceAPI(1,0,0);
}

Execution result.

If OpenApi is called successfully, LXDeviceAPI window & tray icon appears at the  bottom right.

CloseApi

Definition

 

int CloseApi_LXDeviceAPI();

Return Values

Return  meaning Description
 1  Success
 -10  Fail. Nothing to close.  CloseApi should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuCloseapi()
{
 CloseApi_LXDeviceAPI();
}

 

OpenDevice

Definition

 

int OpenDevice_LXDeviceAPI(int LXDeviceID, ST_STREAMDATA_LXDAPI * p_streamdata,int numsample_return,int mode);

Parameters

Parameter Available Value Description
 int LXDeviceID
  • 1~65535
Uinque ID of the device to communicate.
 ST_STREAMDATA_LXDAPI * p_streamdata
  • Address struct type of ST_STREAMDATA_LXDAPI
example.

ST_STREAMDATA_LXDAPI stStreamData; 
OpenDevice_LXDeviceAPI( , &stStreamData, , );

 

int numsample_return
  •  1~128
The number of sampling point  per one stream message.
int mode
  •  0: (default)
reserved

Return Values

Return  meaning Description
  > 0  Success. Device Handling ID. Application program must save the return value to call the other functions which has a parameter int device_handling_id
 -1  Fail. Not supporting device.
 -2  Fail. Duplicated Call Already succefully called OpenApi.
 -3  Fail. No device found matching LXDeviceID.
 -5  Fail. Need to update the device firmware. Try again after completing the device firmware update.
 -10  Fail. Wrong Calling order  OpenDevice should be called after OpenApi.
 -20  Fail. Wrong paramter  int numsample_return should be range of 1~128.

Code Example 1

/*
 Device to open : QEEG-64FX max 64ch option, LXDeviceID = 16464
*/

void CLXDeviceAPI_Sample1View::OnMenuOpendevice()
{
  int retv = OpenDevice_LXDeviceAPI(16464, &stStreamData, NumSampleReturn, 0);

  if(retv > 0) // if success
  {
    m_iDeviceHandlingID = retv; 
  }
  else
  {
    AfxMessageBox(_T("Fail to OpenDevice"));
  }
}

Result.

After calling the function OpenDevice, the Device Control Panel appears on bottom right side.

Device Control Panel

Device Control Panel

Code Example 2

/*
OpenAPI-> OpenDevice -> StartStream at the same time 
Device to open : QEEG-64FX max 64ch option, LXDeviceID = 16464
*/

void CLXDeviceAPI_Sample1View::OnMenuOneclickstart()
{
  int retv_openapi, retv_opendevice; 

  retv_openapi = OpenApi_LXDeviceAPI(1, 0, 0); // API Open.

  if (retv_openapi > 0)
  {
    retv_opendevice = OpenDevice_LXDeviceAPI(16464, &stStreamData, NumSampleReturn, 0); 
    if (retv_opendevice > 0)
    {
      m_iDeviceHandlingID = retv_opendevice; 
      SetMessageDevice_LXDeviceAPI(m_iDeviceHandlingID, 0, this->m_hWnd, WM_LXDAPI_MSGTYPEID_0, 1);

      StartStream_LXDeviceAPI(m_iDeviceHandlingID);
    }
  }
}

 

CloseDevice

Definition

 

int CloseDevice_LXDeviceAPI(int device_handling_id);

Parameters

Parameter Available Value Description
 int device_handling_id
  • return value of OpenDevice

Return Values

Return  meaning Description
 1  Success.
 -3  Fail. No device matching device_handling_id.
 -10  Fail. Wrong calling order. CloseDevice should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuClosedevice()
{
  CloseDevice_LXDeviceAPI(m_iDeviceHandlingID);
}

 

StartStream

Definition

 

int StartStream_LXDeviceAPI(int device_handling_id, int mode);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int mode
  • 0 : (Default)
Reserved.

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -5  Fail. Impedance measuring mode.
 -6  Fail. Auto calibrarion mode.
 -10  Fail. Wrong calling order. StartStream should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuStartstream()
{

  StartStream_LXDeviceAPI(m_iDeviceHandlingID);
}

 

StopStream

Definition

 

int StopStream_LXDeviceAPI (int device_handling_id);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. StopStream should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuStopstream()
{
  StopStream_LXDeviceAPI(m_iDeviceHandlingID);
}

 

GetStreamData

Definition

 

int GetStreamData_LXDeviceAPI(unsigned int message_wparam);

Parameters

Parameter Available Value Description
unsigned int message_wparam
  • (unsigned int)wParam
The parameter wParam from application’s message handler function.

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. GetStreamData should be called after OpenApi.

Code Example

afx_msg LRESULT CLXDeviceAPI_Sample1View::OnStreamData(WPARAM wParam, LPARAM lParam)
{
 unsigned int uintWPARAM = (unsigned int)wParam; 
 unsigned char msgtype_id = (unsigned char)(uintWPARAM >> 8)  ; //get the lowest 2'nd byte(message type id).
 unsigned char msgtype_subid = (unsigned char)(uintWPARAM); //get the lowest 1st byte(message type sub id).

 switch (msgtype_id)
 {
 case MSGTYPEID0_DEVICE_LXDAPI: // for real time stream type messages. 

  switch (msgtype_subid)
  {
  case 0:

   GetStreamData_LXDeviceAPI(uintWPARAM); // After call this function. the new stream data is allocated on stStreamData which is ST_STREAMDATA_LXDAPI type variable.  

   /// Data arrange for Wave Stream Data for plotting. 
   for (int i = 0; i < NumSampleReturn * NumChannel; i++)
   {
    testfloat_Wave[i] = (float)stStreamData.Wave_StreamData_CS[i];
   }

   /// Data arrange for Event Marking for plotting.
   for (int idx_event = 0; idx_event < NumSampleReturn; idx_event++)
    testfloat_Wave[NumSampleReturn * NumChannel + idx_event] = (float)stStreamData.Event_StreamData_CS[idx_event];

   // Plotting the wave and event marking. 
   ACQPLOT_DLL_Array_Datain_Strip(testfloat_Wave, NumChannel + 1, NumSampleReturn); //인자의미. 1번 :float형 파형 데이터배열의 포인터, 2번인자 : 총 채널수 +1 for Event Marking, 1채널당 샘플링 수량.


   break;

  } // switch (msgtype_subid)

  break;  // case MSGTYPEID0_DEVICE_LXDAPI: // for real time stream type messages. 
 }// switch (msgtype_id)


 return 0;
}

 

 

EventMarkingOnStream

Definition

 

int EventMarkingOnStream_LXDeviceAPI(int device_handling_id, unsigned int event_id);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
unsigned int event_id
  • 1~ 65535.
The event_id will be marked on signal stream. When you retrieve the marked value from stream, you can recognize the what type of the event( press the key , image shown, etc. ) has been marked on stream.

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. Should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuEventmarkingonstream()
{
  EventMarkingOnStream_LXDeviceAPI(m_iDeviceHandlingID,20000);
}

Result

SetMessageDevice

Definition

 

int SetMessageDevice_LXDeviceAPI(int device_handling_id,int msgtype_id,HWND hwnd_msgrcv,int msg_id,int onoff);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int msgtype_id
  • MSGTYPEID0_DEVICE_LXDAPI
  • MSGTYPEID9_DEVICE_LXDAPI
Predefined on LXDeviceAPI.h
HWAND hwnd_msgrcv
  • window handle
App.’s window handle to receive the message from LXDeviceAPI.
int msg_id
  • WM_USER ~ WM_USER+31643
  • WM_APP ~ WM_APP+16383
You should define the unique message id without duplication with the other messages in your project.
int onoff
  • 0 : message off
  • 1 : message on
 message(correspond to int msgtype_id ) on/off

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. SetMessageDevice should be called after OpenApi.

Code Example

#define WM_STREAM_DEVICE  WM_USER+203 // You must define the message without duplication with any other messages in your program.

void CLXDeviceAPI_Sample1View::OnMenuSetmessagedevice()
{
  // Mandatory for receiving the stream data from LXDeviceAPI.
  SetMessageDevice_LXDeviceAPI(m_iDeviceHandlingID, MSGTYPEID0_DEVICE_LXDAPI, this->m_hWnd, WM_STREAM_DEVICE,1); 
}

 

SetSampleFrequency

Definition

 

int SetSampleFrequency_LXDeviceAPI(int device_handling_id, unsigned int sample_frequency);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
unsigned int sample_frequency
  • 250,500,1000,2000
Sampling Frequency. unit : Hz.

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. SetMessageDevice should be called after OpenApi.
 -20  Fail. Not supporting value of unsigned int sample_frequency

Code Example

void CLXDeviceAPI_Sample1View::OnSetsamplefrequency2000hz()
{
  SetSampleFrequency_LXDeviceAPI(m_iDeviceHandlingID, 500); //set as 500Hz 
}

 

SetDeviceControlPanel

Definition

 

int SetDeviceControlPanel_LXDeviceAPI(int device_handling_id,int para0, int para1);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int para0
  • 0 : Select all elements.
Target elements in API’s Device Control Panael.
int para1
  • 0 : disable
  • 1 : enable
Enable/disable the target elements selected by int para0

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. StopStream should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuSetdevicecontrolpanel()
{
  static int para1=0; 
  SetDeviceControlPanel_LXDeviceAPI(m_iDeviceHandlingID, 0, para1);
  // toggling para1.
  if (para1) para1 = 0; 
  else para1 = 1; 
}

Result

Device Control Panel disabled.

Device Control Panel disabled.

GetFilterFrequency

Definition

 

int GetFilterFrequency_LXDeviceAPI(int device_handling_id,int signal_source, float * freq_hpf, float * freq_lpf, float * freq_notch);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int signal_source
  • 0 : EEG
  • 1 : EOG
  • 2 : ECG
Select bio signal type to retrieve the applied filter information.
float * freq_hpf
  • output
High Pass Filter cut frequency. unit : Hz. The value -100 means  No HPF applied.
float * freq_lpf
  •  output
Low Pass Filter cut frequency. unit : Hz. The value -100 means  no LPF applied.
float * freq_notch
  •  output
Notch Filter frequency. uint : Hz. The value -100 means  no notch filter applied.

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. GetFilterFrequency should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuGetfilterfrequency()
{
  float f_hpf, f_lpf, f_notch;
  CString cst_hpf, cst_lpf, cst_notch;
  // Get EEG Filter info 
  if (GetFilterFrequency_LXDeviceAPI(m_iDeviceHandlingID,0, &f_hpf, &f_lpf, &f_notch) == 1) 
  {
    if (f_hpf < -1.f) 	cst_hpf = _T("HPF=off, ");
    else		cst_hpf.Format(_T("HPF=%.1fHz, "), f_hpf); 

    if (f_lpf < -1.f)	cst_lpf = _T("LPF=off, ");
    else		cst_lpf.Format(_T("LPF=%.1fHz, "), f_lpf);

    if (f_notch < -1.f)	cst_notch = _T("Notch=off");
    else		cst_notch.Format(_T("Notch=%.1fHz"), f_notch);

    AfxMessageBox(_T("EEG Filter : ") + cst_hpf + cst_lpf + cst_notch);
  }
}

Result

Signal Filter Frequencies

Signal Filter Frequencies

GetSampleFrequency

Definition

int GetSampleFrequency_LXDeviceAPI(int device_handling_id, int * sample_frequency);

 

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int * sample_frequency
  • output

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. GetFilterFrequency should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuGetsamplefrequency()
{
  int sample_frequency; 
  CString cst; 

  if (GetSampleFrequency_LXDeviceAPI(m_iDeviceHandlingID, &sample_frequency) == 1)
  {
    cst.Format(_T("Sampling Frequency = %d Hz"), sample_frequency);

    AfxMessageBox(cst);
  }
}

Result

GetSampleFrequency

GetSampleFrequency

GetEEGRefElectrode

Definition

 

int GetEEGRefElectrode_LXDeviceAPI(int device_handling_id , int * eeg_refelectrode);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int * eeg_refelectrode
  • 0 : A1
  • 1 : A2
  • 2 : A1,A2
  • 3 : Cz (ch18)
Retrieving the selected EEG reference electrode. Cz is available only if EEG Cap is introduced.

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. GetFilterFrequency should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuGeteegrefelectrode()
{
  int eeg_refelectrode; 
  CString cst_eegref; 

  if (GetEEGRefElectrode_LXDeviceAPI(m_iDeviceHandlingID,&eeg_refelectrode) == 1)
  {
    if (eeg_refelectrode == 0)		cst_eegref = _T("A1");
    else if (eeg_refelectrode == 1)	cst_eegref = _T("A2");
    else if (eeg_refelectrode == 2)	cst_eegref = _T("A1+A2");
    else if (eeg_refelectrode == 3)	cst_eegref = _T("Cz(ch18)");

    AfxMessageBox(_T("EEG Reference Electode = ") + cst_eegref); 
  }
}

Result

EEG reference electode

EEG reference electode

CheckForUpdate

Definition

 

int CheckForUpdate_LXDeviceAPI(int closeifnoupdate);

Parameters

Parameter Available Value Description
 int closeifnoupdate
  • 0, 1
 1 : Auto close update window if there is no update

0 : Don’t close update window although there is no update.

Return Values

Return  meaning Description
 1  Success
 -10  Fail. Wrong calling order. Should be called after OpenApi.

Code Example

void CLXDeviceAPI_Sample1View::OnMenuCheckforupdate()
{
 CheckForUpdate_LXDeviceAPI(0); // parameter 0 : No Auto Close 
 //CheckForUpdate_LXDeviceAPI(1); // parameter 1 : Auto close check program if there is no update.
}

Result

CheckForUpdate LXDeviceAPI

CheckForUpdate LXDeviceAPI

API User Interfaces

 

LXDeviceAPI provides the self-contained GUIs which are essential and necessary to handle the devices. Unlike the API Messages and API Functions, there is no need to control API GUIs by your application programs.

This slideshow requires JavaScript.

Device Control Panel

 

Device Control Panel

Device Control Panel

Impedance

 

Impedance

Impedance Electrode-Skin

 

 

Auto Calibration

 

Before Auto Calibration

Before Auto Calibration

 

Completed Auto Calibration

Completed Auto Calibration

 

API Self Update

Device Firmware Update

 

Programming Guide

 

Quick guide for programming

Prerequisite

In this example, the s/w developing PC should be connected to QEEG-64FX via USB.

QEEG-64FX PC USB

Quick Start – Using Sample Project.

The sample project “LXDeviceAPI_Sample1” is the simplest example source code made by Visual C++ 2015. The “LXDeviceAPI_Sample1” is downloadable from GitHub repository.

step 1. Let’s call function OpenApi and then CloseApi.

The LXDeviceAPI window appears after calling OpenApi, disappears after calling CloseApi.

step 2. Starting Stream for acquiring the real time bio signal.

Call the API functions OpenApi , OpenDevice, SetMessageDevice and StartStream.

After call StartStrem, LXDeviceAPI send a stream message to application program. Application’s message handler must call the GetStreamData to get the unit stream data. Now you can use a unit stream data for plotting, saving and any processing you need.

step 3. Closing  the LXDeviceAPI

If there is no need to use LXDeviceAPI anymore, call the functions StopStream, CloseDevice and CloseApi.

Overall procedure can be seen following video,

 

Supporting Devices

 

Device Model (Channel Option) LXDeviceID Sampling Frequency(Hz) Channel Index vs. Signal Source
QEEG-64FX (8ch)  16408 250,500,1000,2000
  • 0~7 : EEG Ch1~8
  • 8 : EOG1, 9 : EOG2, 10 : ECG
QEEG-64FX (16ch)  16416 250,500,1000,2000
  • 0~15 : EEG Ch1~16
  • 16 : EOG1, 17 : EOG2, 18 : ECG
QEEG-64FX (24ch)  16424 250,500,1000,2000
  • 0~23 : EEG Ch1~24
  • 24 : EOG1, 25 : EOG2, 26 : ECG
QEEG-64FX (32ch)  16432 250,500,1000,2000
  • 0~31 : EEG Ch1~32
  • 32 : EOG1, 33 : EOG2, 34 : ECG
QEEG-64FX (40ch)  16440 250,500,1000
  • 0~39 : EEG Ch1~40
  • 40 : EOG1, 41 : EOG2, 42 : ECG
QEEG-64FX (48ch)  16448 250,500,1000
  • 0~47 : EEG Ch1~48
  • 48 : EOG1, 49 : EOG2, 50 : ECG
QEEG-64FX (56ch)  16456 250,500,1000
  • 0~55 : EEG Ch1~56
  • 56 : EOG1, 57 : EOG2, 58 : ECG
QEEG-64FX (64ch)  16464 250,500,1000
  • 0~63 : EEG Ch1~64
  • 64 : EOG1, 65 : EOG2, 66 : ECG
QEEG-32FX  300 250,500,1000,2000
  • 0~31 : EEG Ch1~32
  • 32 : EOG1, 33 : EOG2, 34 : ECG

 

Downloads

LXDeviceAPI for 32bit Applications.

 LXDeviceAPI_32bit.zip download.

 

LXDeviceAPI for 64bit Applications.

 LXDeviceAPI_64bit.zip download.

 

 


Sample Projects

 Name  LXDeviceAPI_Sample1
 Description
  • The simplest example source which shows how to use LXDeviceAPI.
  • Visual C++ 2015, MFC SDI Project.
  • Available both 32bit / 64bit platforms.
 Download   LXDeviceAPI_Sample1 zip file download.
 GitHub   https://github.com/LAXTHA/LXDeviceAPI_Sample1

 


LXDeviceAPI Documents.

 Developer Manual.  download or view online.

 

 

 

 

 

 

 

 

 

 

 

 

 

Suggest Edit