OkoLib
library for accessing Okolab devices
Typical Implementation

A typical implementation of the communication with an Okolab device using the SDK would consist of a sequence of function calls depending on the overall scenario.

Modules

Case 1

Detect all the avaiable modules and collect their fixed details.

Case 2

Using the already obtained types, periodically query setpoint and current value of each module.

Case 3

Using the already obtained types, change the setpoint of each module.

Device initialization

Case 1

No previous knowledge of the connected device

  • oko_DevicesDetect Obtain the number of device connected and their handles as an array. For each handle
    • oko_DeviceGetPortName Store the port name to avoid going through the detect procedure next time software is started

Case 2

Previous knowledge of the device ComPort# (e.g. by user input or previously stored by the application).

  • oko_DeviceOpen Obtain the handle of the device connected to ComPort#.

Properties initialization

Property usage by Name

Case 1

Get the last value of a read only property

Case 2

First update the value from the device and then read a property value of a known type

Case 3

Synchronously change the value of a property (e.g. with double type)

Case 4

Change the value of a property (e.g. with double type), without waiting for the result

Auto-updating a property

A property can be auto-updated by an internal thread, so the application doesn't need to esplicity update it, calling oko_PropertyUpdate.

Case 1

Make a property auto-updating

Case 2

Read the last property value

Close Device

Case 1

No previous knowledge of the connected device

Case 2

Previous knowledge of the device