OkoLib
library for accessing Okolab devices
Modules

Typedefs

typedef enum _oko_module_type oko_module_type
 Specifies the available modules types.
 

Enumerations

enum  _oko_module_type {
  OKO_MODULE_TEMP = 0,
  OKO_MODULE_CO2 = 1,
  OKO_MODULE_O2 = 2,
  OKO_MODULE_HMD = 3,
  OKO_MODULE_MAXNUM
}
 Specifies the available modules types. More...
 

Functions

oko_res_type oko_ModulesDetect (uint32_t max_num, oko_module_type *modules, uint32_t *detected_num)
 Detect available modules and open them, returning the type for each module. More...
 
oko_res_type oko_ModulesDetectSelected (const oko_module_type *selected_modules, uint32_t selected_modules_num, oko_module_type *modules, uint32_t *detected_num)
 Detect available modules and open them, returning the type for each module. More...
 
oko_res_type oko_ModuleGetDetails (oko_module_type module, char *name, char *dim_unit, bool *can_disable)
 Returns all information about of the specified module of this device, which is not changing during application runtime. More...
 
oko_res_type oko_ModuleGetCurrentValue (oko_module_type module, double *current_value)
 Returns current value of the specified module. More...
 
oko_res_type oko_ModuleGetSetpointValue (oko_module_type module, double *setpoint_value)
 Returns setpoint value of the specified module of this device. More...
 
oko_res_type oko_ModuleGetLimits (oko_module_type module, double *min_value, double *max_value)
 Returns setpoint limits of the specified module of this device. More...
 
oko_res_type oko_ModuleSetSetpointValue (oko_module_type module, double setpoint_value)
 Set setpoint of the specified module of this device. More...
 
oko_res_type oko_ModuleGetEnabled (oko_module_type module, bool *enabled)
 Returns enable status of the specified module of this device. More...
 
oko_res_type oko_ModuleSetEnabled (oko_module_type module, bool enabled)
 Set enable status of the specified module of this device. More...
 

Detailed Description

Enumeration Type Documentation

Specifies the available modules types.

Enumerator
OKO_MODULE_TEMP 

Temperature module.

OKO_MODULE_CO2 

CO2 module.

OKO_MODULE_O2 

O2 module.

OKO_MODULE_HMD 

Humidity module.

OKO_MODULE_MAXNUM 

Number of available modules.

Function Documentation

oko_res_type oko_ModuleGetCurrentValue ( oko_module_type  module,
double *  current_value 
)

Returns current value of the specified module.

Parameters
[in]modulea valid module specifier (oko_module_type)
[out]current_valueActual/current value
Returns
OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModuleGetDetails ( oko_module_type  module,
char *  name,
char *  dim_unit,
bool *  can_disable 
)

Returns all information about of the specified module of this device, which is not changing during application runtime.

Parameters
[in]modulevalid module type
[out]namename of the module. String needs to be pre-allocated by the caller.
[out]dim_unitdimension unit of the module. String needs to be pre-allocated by the caller.
[out]can_disablereturns, if this module can be disabled or if it is always enabled. '1' for module can be disabled and '0' for module is always enabled.
Returns
OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModuleGetEnabled ( oko_module_type  module,
bool *  enabled 
)

Returns enable status of the specified module of this device.

  • CO2 and Humidity enabled are false when gas flow is off.
  • O2 module enabled is false when gas flow is off or AIR mode is set (CO2 mode).
    Parameters
    [in]modulea valid module specifier (oko_module_type)
    [out]enabledenabled status (true/false)
    Returns
    OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModuleGetLimits ( oko_module_type  module,
double *  min_value,
double *  max_value 
)

Returns setpoint limits of the specified module of this device.

Parameters
[in]modulea valid module specifier (oko_module_type)
[out]min_valueminimum value that can be used as setpoint
[out]max_valuemaximum value that can be used as setpoint
Returns
OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModuleGetSetpointValue ( oko_module_type  module,
double *  setpoint_value 
)

Returns setpoint value of the specified module of this device.

Parameters
[in]modulea valid module specifier (oko_module_type)
[out]setpoint_valuesetpoint value
Returns
OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModulesDetect ( uint32_t  max_num,
oko_module_type modules,
uint32_t *  detected_num 
)

Detect available modules and open them, returning the type for each module.

Parameters
[in]max_numThe max number of devices to detect.
[out]modulesArray of the detected module types.
[out]detected_numnumber of detected modules. It is the length of modules array.
Returns
OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModulesDetectSelected ( const oko_module_type selected_modules,
uint32_t  selected_modules_num,
oko_module_type modules,
uint32_t *  detected_num 
)

Detect available modules and open them, returning the type for each module.

Keep only modules of interest according to specified module types.

Parameters
[in]selected_modulesarray of module types to select
[in]selected_modules_numlength of selected_modules array
[out]modulesArray of module types.
[out]detected_numnumber of detected modules. It is the length of modules array.
Returns
OKO_OK upon success, an error code otherwise.
oko_res_type oko_ModuleSetEnabled ( oko_module_type  module,
bool  enabled 
)

Set enable status of the specified module of this device.

  • When CO2 or Humidity is enabled, flow is turned on.
  • When CO2 or Humidity is disabled, flow is turned off.
  • When O2 is enabled, CO2/O2 mode is set and gas flow is turned on.
  • When O2 is disabled, CO2 mode is set (AIR mode).
Parameters
[in]modulea valid module specifier (oko_module_type)
[in]enablednew enable status for this module (true/false)
Returns
OKO_OK upon success, an error code otherwise.
Note
  • CO2 and Humidity modules are enabled/disabled synchronously.
  • When CO2 or Humidity is disabled, O2 is disabled too.
  • When CO2 or Humidity is enabled, O2 is enabled only if mode is CO2/O2.
  • When O2 is enabled, CO2 and Humidity are enabled too (if disabled).
Warning
Some gas devices (eg. CO2-O2 Unit-BL [0-20;1-95]) need a special tubing configuration to work in CO2 mode. Please check the device user manual.
oko_res_type oko_ModuleSetSetpointValue ( oko_module_type  module,
double  setpoint_value 
)

Set setpoint of the specified module of this device.

Parameters
[in]modulea valid module specifier (oko_module_type)
[in]setpoint_valuenew setpoint for this module, has to be between minimum and maximum of this module.
Returns
OKO_OK upon success, an error code otherwise.