microCOR Lab SDK  1.7
 All Classes Files Functions Enumerations Enumerator Modules
microCORLab C API

Classes

struct  microCORLabStatesStruct
 
struct  microCORLabStates
 

Macros

#define MICROCORLAB_TIMESIZE   50
 
#define CHNL_CNT   8
 
#define EKG_CNT   12
 
#define RESOLUTION_SHIFT_MIN   0
 
#define RESOLUTION_SHIFT_MAX   8
 

Typedefs

typedef struct
microCORLabStatesStruct 
microCORLabStates
 

Functions

microCORLabStates MC_C_EXPORT microCORLab_states ()
 returns state struct
 
MC_C_EXPORT const char * microCORLab_info ()
 returns info string
 
int MC_C_EXPORT microCORLab_init (const char *serialNo, const char *logFile, int64_t timeout)
 Call this function first to use C API. More...
 
void MC_C_EXPORT microCORLab_free ()
 Call this function at the end of your program. More...
 
int MC_C_EXPORT microCORLab_start ()
 microCORLab_start More...
 
void MC_C_EXPORT microCORLab_stop ()
 stops data acquisition.
 
int MC_C_EXPORT microCORLab_data (double *data, int size)
 data More...
 
void MC_C_EXPORT microCORLab_setTimeEnabled (int enabled)
 set time channel enabled
 
int MC_C_EXPORT microCORLab_setChannelEnabled (int channel, int enabled)
 set channel enabled. Channels starts at zero. More...
 
void MC_C_EXPORT microCORLab_setTriggerEnabled (int enabled)
 set trigger
 
void MC_C_EXPORT microCORLab_setReferenceMode (int mode)
 set reference mode. More...
 
void MC_C_EXPORT microCORLab_setResolutionShift (int shift)
 set resolution shift More...
 
void MC_C_EXPORT microCORLab_setShutdownTerminal (int enabled)
 set shutdown terminal
 
int MC_C_EXPORT microCORLab_isNaN (double value)
 is not-a-number More...
 
void MC_C_EXPORT microCORLab_timeToString (double t, char *s)
 is not-a-number More...
 
MC_C_EXPORT const char * microCORLab_usbDeviceToString (int value)
 returns state name.
 
MC_C_EXPORT const char * microCORLab_gatewayToString (int value)
 returns state name.
 
MC_C_EXPORT const char * microCORLab_terminalToString (int value)
 returns state name.
 
MC_C_EXPORT const char * microCORLab_terminalTypeToString (int value)
 convert terminal type to string More...
 
MC_C_EXPORT const char * microCORLab_terminalRunningToString (int value)
 returns state name.
 
MC_C_EXPORT const char * microCORLab_batteryToString (int value)
 returns state name.
 
MC_C_EXPORT const char * microCORLab_samplingToString (int value)
 returns state name.
 
MC_C_EXPORT const char * microCORLab_referenceModeToString (int value)
 returns reference mode name.
 

Detailed Description

Macro Definition Documentation

#define CHNL_CNT   8

Raw channel count

#define EKG_CNT   12

Ekg channel count

#define MICROCORLAB_TIMESIZE   50

sizeof "yyyy.mm.dd hh:MM:SS.FFFZZZZ"

#define RESOLUTION_SHIFT_MAX   8

Max resolution shift

Examples:
mainwindow.cpp.
#define RESOLUTION_SHIFT_MIN   0

Min resolution shift

Examples:
mainwindow.cpp.

Function Documentation

int MC_C_EXPORT microCORLab_data ( double *  data,
int  size 
)

data

Parameters
datapreallocated data array
sizesize of the data.
Returns
-1 on error, else written sample count
Warning
data array have to be created before call this function.

To calcutale size, use this relation: size = rowCount * columnCount * sizeof(double)

Unit is microvolt (uV). Resolution is; 104 x 1 = 104nV if shift 0, 104 x 2 = 208nV if shift 1, 104 x 4 = 416nV if shift 3, 104 x 8 = 832nV if shift 4, ...

Labels as ordered for reference;

  • Default { Ch0, Ch1, Ch2, Ch3, Ch4, Ch5 }
  • Ekg { I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5, V6 }
void MC_C_EXPORT microCORLab_free ( )

Call this function at the end of your program.

See also
microCORLab_init();
int MC_C_EXPORT microCORLab_init ( const char *  serialNo,
const char *  logFile,
int64_t  timeout 
)

Call this function first to use C API.

Parameters
serialNoTerminal serial no. Give empty to connect default.
logFileLog file. Set empty string to disable.
timeoutwait until library thread started, or return if timeout msec.
Returns
If success 1, else 0.
See also
microCORLab_free();
int MC_C_EXPORT microCORLab_isNaN ( double  value)

is not-a-number

Parameters
valueto check
Returns
if not initted -1, else isnan result
int MC_C_EXPORT microCORLab_setChannelEnabled ( int  channel,
int  enabled 
)

set channel enabled. Channels starts at zero.

Returns
1 if success, else 0.
Note
Works only if not started and no captured data.

If resolution is default, channel range is 0..7. If resolution is ekg, channel range is 0..11.

void MC_C_EXPORT microCORLab_setReferenceMode ( int  mode)

set reference mode.

Parameters
modereference mode. 0 : default mode, 1: ekg mode.
Warning
Enalbles all data channels, stops if started, and clears data.
void MC_C_EXPORT microCORLab_setResolutionShift ( int  shift)

set resolution shift

Parameters
shiftshift value
int MC_C_EXPORT microCORLab_start ( )

microCORLab_start

Parameters
resolutionResolution shift (0...7).
autoShutdownShuts down the device after given minutes. Give 0 to not during data acquisition.
Returns
1 if started, else 0.

Resulution shift value is useing to increase transmission compression. More shifting reduces resolution.

0 will not shift, and most accurate data will be gathered. 7 will shift 7 times during transmission, and most compressed value with low resolution will get.

MC_C_EXPORT const char* microCORLab_terminalTypeToString ( int  value)

convert terminal type to string

Returns
device type string
void MC_C_EXPORT microCORLab_timeToString ( double  t,
char *  s 
)

is not-a-number

Parameters
ttime value which gathered from microCORLab_data().
sstring result like "yyyy.mm.dd hh:MM:SS.FFFZZZ"
Warning
s char array have to be created at size MICROCORLAB_TIMESIZE before call.

Time column is calculated like thist; sample_elaps = 1000/552.75=1,809136... First sample time + (sample_elaps * sequence number).