0% found this document useful (0 votes)
59 views

User Manual BioDAQ SDK ENG

MANUAL UTILIZATOR BIODAQ SDK

Uploaded by

Cosmin Andrei
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

User Manual BioDAQ SDK ENG

MANUAL UTILIZATOR BIODAQ SDK

Uploaded by

Cosmin Andrei
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 171

BTS BioDAQ SDK

User manual
English
Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

EREMB-0xxxx-0x Pag. 2 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

© Copyright BTS S.p.A. 2000‐2014. All rights reserved.

BTS S.p.A. reserves the right to make changes to this document and the products described in it at any
time and without notice.
This document could contain some errata.
No responsibility is assumed by BTS S.p.A. for any troubles resulting from its use.
Windows®, Windows XP® and Windows 2000® are registered trademarks of Microsoft Corporation®.
All trademarks used are properties of their respective owners.

Document number: EREMB‐0xxxx‐0x


Published: 16/06/2014

EREMB-0xxxx-0x Pag. 3 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Glossary

AUX Auxiliary
BM Base Module
EMG Electromyographic
EGN Electrogoniometric
FSW Footswitch
MAC Media Access Control
PAN Personal Area Network
SDK Software Development Kit

EREMB-0xxxx-0x Pag. 4 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

EREMB-0xxxx-0x Pag. 5 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

1 Introduction

1.1 Purpose of reference manual


The SDK (Software Development Kit) is a collection of software libraries and documents developed by BTS
to support the development of application for BTS systems with “EMG Embedded” technology.
The scope of this document is to provide a general description of the SDK and how to use its interfaces to
create an application capable of controlling the systems RT of BTS mentioned above.

1.2 System requirements


This document assumes the following:
• Microsoft XP operative system or greater (the system is NOT compatible with Win8 operative
system and Win8 RT operative system);
• Microsoft® .NET Framework 3.5 preinstalled;
• FTDI® driver release 2.08.02 or greater for the USB‐RS232 conversion, preinstalled.

For a complete knowledge it must assume the following:


• The user has some familiarity with C, C++, Microsoft Visual Studio environment;
• The user has some familiarity with COM components;
• The SDK has been installed.

With the IDE Microsoft® Visual Studio® 2010 and/or greater the user can compile and use the samples
provided with the installation package.
The compatibility with IDE Microsoft® Visual Studio® 2008 is ensured with the issue to use Microsoft® .NET
Framework 3.5 support.
The compatibility with IDE Microsoft® Visual Studio® 2005 or smaller is NOT ensured.
The application written by the user must use the Microsoft® .NET Framework 3.5 or greater (TODO: check
this!!).

Refer to the instructions contained in this manual for information on how to install the SDK.

1.3 Installation
TODO....

EREMB-0xxxx-0x Pag. 6 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

2 Architecture
The SDK is composed by a collection of libraries developed with “Microsoft .NET” technology and with the
exclusion of the library for saving data in TDF file format, the libraries are written in C# language.
In order to allow the development of applications not only in “managed “ language, but also “unmanaged”
(for example C++) the software modules are implemented using COM type interfaces.

The package provided is made up of the following components:


• bts.biodaq.core.dll: this is the library through which the application interfaces directly. It contains
all the main modules necessary to control, configure the system and to manage the data
acquisition.
• bts.biodaq.drivers.dll: in this library the high level drivers to manage communications with the
“Base Module” are developed. This communication takes place only through the virtual or
“physical” COM port.
• bts.biodaq.utils.dll: this library contains general utility functions (i.e. management of FTDI
converter).
• tdfAccess100.dll: library used internally by the SDK for conversion of data in TDF format (BTS format
proprietary for data files).
• log4net.dll: “open source” framework used for “information logging” inside the SDK.
• samples.sln: the solution is developed with Microsoft Visual Studio 2010 (.NET framework 3.5), the
solution contains samples implemented in C# language and samples implemented in C++ language.
For the development of the application all the modules described above are necessary with the exception
of the applications provided with the package, obviously in addition to the requirements defined in the
previous section.

3 SDK description

BASIC CONCEPTS
Control of the system by the application takes place through the “BioDAQ” object using the methods and
properties made available by its “IBioDAQ” interface and which it will be described in this manual.
In general through this interface the system is initialized, it is configured, the resources are enumerated
and the acquisitions are piloted with relative data management.
Before describing in details properties and methods exported by the interface of SDK libraries, some basic
concepts must be described.

SYSTEM RESOURCES
“Resources” mean the following elements:
• Base Module (BM): this is the device that controls the wireless network to which the BTS sensors
are connected and which can be a maximum of 1 in the current version of system.
• Sensors: these are the BTS devices that connect to the BM and which acquire data. Each BM can
manage up to a maximum of 10.
The BTS sensors belong to the following types:
1. EMG sensors: these sensors acquire electromyographic data;

EREMB-0xxxx-0x Pag. 7 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

2. AUX sensors: these sensors acquire data from Biometrics twin axis goniometers for the
measurement of angles and data from footswitch contact areas;
3. AUXEGN sensors: these sensors acquire data from Biometrics twin axis goniometers for the
measurement of angles (reserved);
4. AUXFSW sensors: these sensors acquire data from footswitch contact areas (reserved).
Each sensor is identified by 8 byte MAC address serial number. MAC address is strictly related to
the type of sensor. According to the type of sensors, MAC address of sensor has the following
encoding:
1. EMG sensor: MAC address: 02-B7-5E-00-05-XX-XX-XX
2. AUX sensor: MAC address: 02-B7-5E-00-06-XX-XX-XX
3. AUXEGN sensor: MAC address: 02-B7-5E-00-07-XX-XX-XX
4. AUXFSW sensor: MAC address: 02-B7-5E-00-08-XX-XX-XX
The last 3 bytes are the unique identifier for each sensor on the sensor itself (on the metallic clip for
the EMG, on the plastic case for AUX, AUXEGN and AUXFSW).
The sensors are identified by a color and a label (alphanumeric code).
The allowed colors are: Blue, Red, Yellow, Green and Black. The label must respect the following: a
numeric value from “1” to “255” for EMG sensor, a letter from “A” to “Z” for AUX sensor, AUXEGN
sensor and AUXFSW sensor.
• Channels: these are the logical data channels associated with each sensor. The number can vary
depending on the type of sensor ad its configuration, that is:
1. EMG sensor: 1 channel.
2. AUX sensor: 2 channels in EGN mode and 4 channels in FSW mode.
3. AUXEGN sensor: 2 channels (only EGN mode).
4. AUXFSW sensor: 4 channels (only FSW mode).
For each of these types of resources there is a “list” (in the general sense of the term) which can be
accessed within certain limits. These lists are generated at system initialization or in case of reconfiguration
of the same when the profile or the protocol is changed (see definitions of PROFILE and PROTOCOL for
further details).

CONFIGURATION
Each base module has a configuration defined by two parameters:
1. Radio channel code on which the wireless network is activated;
2. Identifier of the wireless network which is activated on the radio channel above (PANId parameter).

PROFILE
The profile is a list of sensors, identified by the MAC addresses and their labels (color‐alphanumeric
character), assigned to the system.

PROTOCOL
The protocol is a list of channels (with their parameters) which are intended to be acquired and which must
be compatible with the profile currently in use.

SINK
The sink represents the destination to which the acquired data by the system is addressed. The SDK is
capable of managing several sinks simultaneously which are collected in a list made available by the
interface.

EREMB-0xxxx-0x Pag. 8 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Three sinks are implemented in the SDK. This group can be extended, obviously implementing an “ISink”
type interface. The currently implemented sinks are:
• Queue sink: stores the data in “Queue” type structure;
• Disk sink: stores the data on a binary file in the disk with a custom format after a selected real‐time
data processing. The data are then available for subsequent conversion in TDF file;
• Math sink: stores the data in “Queue” type structure after the selected real‐time data processing
(see PROCESSOR).

PROCESSOR
It carries out the real‐time data processing and it is used in conjunction with the MathSink and with the
DiskSink (see SINK above).
The SDK implements the following three processor types:
1. Transparent Processor: the data are NOT processed but they are stored and/or they are written in a
file as they are received;
2. RMS Processor: it carries out the calculation of the RMS according to the set configurations before
they are stored and/or they are written in a file;
3. EMA Processor: it applied the EMA (Exponential Moving Average) filter to the data before they are
stored and/or they are written in a file.

STATE MACHINE
In the Figure 1 below the main state machine of BioDAQ interface is described. There are 7 different states:
• Idle;
• Ready;
• Armed;
• Capturing;
• Recording;
• Downloading;
• Error.
The meaning of the states, the state transitions and what operations are possible is described below.
IDLE State
This state is reached by default when the BioDAQ object is created or after a reset operation. In this state
the SDK does not have control of the hardware communication ports.

READY State
This state is reached when the system is initialized or after the end of an acquisition.
In initialization phase the following operations are carried out:
• Instantiation of the drivers and opening of the requested communication ports;
• Initialization of the system and enumeration of all resources available to the system: BM, sensors
and channels.

EREMB-0xxxx-0x Pag. 9 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

IDLE ERROR
Init
DOWNLOADING
Download
Reset

DownloadAbort

ApplyConfig
ApplyProfile
ApplyProtocol READY RECORDING
Stop
Trigger

Record

Arm Stop

ArmWithEvents

Start
Reset
ARMED CAPTURING
StartWithMemoryMode
Reset

Reset

Figure 1: State machine

In this state, and only in this one, it is possible to modify the configuration of the BM, modify the profile or
the protocol used. It is also possible to add new “sinks” to the existing list of list for data management.

ARMED State
This state is reached when the system is “armed” in order to perform an acquisition. During this operation
all the “time consuming” operations needed for the realization of an acquisition are executed.
In this state only start acquisition and stop acquisition operations are possible, whether they are piloted by
software events or system reset operation.

CAPTURING State
This is the state when an acquisition is in progress: the data are sent to the sinks but not stored, to store
the data it is necessary to get the RECORDING state.

RECORDING State

As in the CAPTURING state an acquisition is in progress but data are also stored. The reference “time = 0”
for the data is the instant in which the recording starts and it is automatically calculated by the BioDAQ.
This is very useful when it is necessary to monitor the data for a long time (acquisition in progress:
CAPTURING state) before the real acquisition (acquisition in progress: RECORDING state).

DOWNLOADING State

EREMB-0xxxx-0x Pag. 10 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

This is the state when the acquired and saved data, in the on‐board memory of EMG probes, are
downloaded to a proper data structure. At the end of download process, the READY state is get.

ERROR State
This state can be reached in various cases, for example due to an hardware communications error or an
error in the protocol application. The type of error which occurred is stored by the BioDAQ interface and it
is made available to the software application (see GetLastError property).
In these types of situations it is not always possible to remedy the cause of the error, for example in
presence of hardware errors. In these cases the system must be reset and the software application
restarted.

In the next pages of the manual the interfaces with related methods and properties are enlisted. The
interfaces are exported by the BioDAQ libraries. For each method, the prototype of function is provided
with description of the parameters that composing the function “signature” and description of returned
value. The function prototype is written in C# language (managed) and C++ language (unmanaged).
In C++ language, for a property exists different prototype functions: all functions are allowed to be used.

4 Drivers library
The bts.biodaq.drivers library contains the command execution status codes reserved for BM en the set of
serial communication errors between BM and external world (application).

4.1 BM command execution status


The BM command execution status has got the following values:
State Value Description
Success 0 Successful operation.
CRCFailed 1 CRC check failed, it follows an invalid data packet reception.
InvalidCode 2 Invalid code.
InvalidArgument 3 Invalid argument.
InvalidOperation 4 Invalid operation.
MaxConfigReached 5 Maximum configuration reached (number of sensors managed by the
BM).
MACAlreadyExists 6 MAC address already exist.
HardwareFailure 7 Generic hardware error (not recovery).

EREMB-0xxxx-0x Pag. 11 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Error 255 Generic error.

4.2 Serial communication errors


The table contains a list of serial communication errors between BM and PC (controller):
Codes Value Description
Success 0 Successful comunication operation.
TimeOut 1 Timeout: BM did not reply in time (for most operation timeout is
set to 5 s).
WriteTimeOut 2 Write time out error: BM does not sent packet in time (Write
time out is set to 50 ms).
CRCFailed 3 CRC check failed: BM receives a bad packet.
RequestMismatch 4 Request/response mismatch.
NotReady 5 Controller not ready to issue a new request.
Busy 6 Controller is already busy to process another request.
ResponsePktNotNull 7 Receive a response while the previous is still being processed.

5 Core library
The bts.biodq.core library contains the following interfaces:
• BioDAQ: main interface to control the system;
• BMView, BMViewList: interfaces to manage the BMs;
• SensorId, SensorIdDictionary, SensorView, SensorViewList, SensorIdDictionaryEnum: interfaces to
handle the sensors;
• Channel, ChannelEMG, ChannelEGN, ChannelFSW, ChannelViewList: interfaces to manage the
channels (EMG, EGN and FSW types) related to the loaded profile;
• CommandBase ?
• DataSink, DataSinkList, DataSinksEnum, DiskSink, MathSink, QueueSink, SinksFactory: interfaces to
manage the “sink” for data acquisition;
• Exporter, TrialReader: interfaces to convert and to save data in a file with custom format (BTS
proprietary format);
• PanConfig, PanConfigList: interfaces to manage the PANs;
• Port, PortCOM, PortList, PortsEnum, PortsManager: interfaces to manage the serial COM ports;
• Processor, RMS Processor, EMA Processor, Transparent: interfaces to configure the processor with
the related “sink”;
• Protocol, ProtocolItem: interfaces to manage the protocol (collection of channels).

EREMB-0xxxx-0x Pag. 12 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.1 BioDAQ interface


The main interface handles the BM and the sensors. The interface can configure a set of sensors, it can
access to internal resources (BM, sensors, channels, protocol) in order to retrieve information about the list
of active BMs, the list of configured sensors and the list of enabled channels to acquire data. The interface
permits to acquire data samples from sensors, to handle the data samples during acquisition process and to
save the samples in a file.

5.1.1 BioDAQ error codes


The table contains the errors code recognized by the BioDAQ interface:
Error codes Value Description
NoError 0 No error encountered.
HardwareError 1 Hardware error communication with BM.
ProtocolError 2 Error applying new protocol to BioDAQ interface.
InternalError 3 Internal error (for example software error, sinks,...).
GenericError 255 Generic error.

5.1.2 BioDAQ exit status codes


The table contains the exit status codes of BioDAQ interface:
Codes Value Description
Success 0 Successful operation.
InvalidArgument 1 Invalid argument.
InvalidOperation 2 Invalid operation.
Failure 255 Generic failure.

5.1.3 BioDAQ state codes


The table contains the states of controller (see SDK description for further details):
State Description
Idle System not connected to any COM port.
Ready System initialized and ready to operate if resources are available.
Armed System ready to acquire data.
Capturing Data capturing is in progress.
Recording Data capturing is in progress and store data (if DiskSink or similar is

EREMB-0xxxx-0x Pag. 13 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

connected).
Downloading Data download is in progress.
Error System enters in an irreversible error state. Currently this happens when
there is a failed communication to BM or a wrong protocol is applied to
BioDAQ interface.

5.1.4 BioDAQDownload status codes


The table contains the exit status codes of BioDAQ interface for the download data operation:
Codes Value Description
Success 0 Successful operation.
ErrorLostConnection 1 Lost connection with at least one probe.
Abort 2 Download data operation is aborted by the user.
ErrorHardware 255 Hardware error communication with BM.

5.1.5 Percent codes for the download data operation


The table contains the percentage values for the download data operation:
Codes Value Description
Percent0 0 0%
Percent20 1 20%
Percent40 2 40%
Percent60 3 60%
Percent80 4 80%
Percent100 5 100%

5.1.6 ActiveProtocol
Prototype:
Protocol ActiveProtocol() {get;}
Description:
Retrieve the active protocol.
Parameters:
Function return parameter:
Protocol Active protocol

C++ version:

EREMB-0xxxx-0x Pag. 14 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Prototype:
IProtocolPtr ActiveProtocol
IProtocolPtr GetActiveProtocol()
HRESULT get_ActiveProtocol( struct IProtocol * * pVal )
Parameters:
Function return parameter:
Protocol Active protocol (COM interface)

5.1.7 Arm
Prototype:
BioDAQExitStatus Arm()
Description:
Execute the system Arm before carrying out an acquisition. During this operation, all the “time‐consuming”
operations necessary for execution of an acquisition are carries out. After an “Arm” operation, it is not
possible to carry out any type of modification.
Parameters:
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:

C++ version:
Prototype:
BioDAQExitStatus Arm()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.8 ArmWithEvents
Prototype:

EREMB-0xxxx-0x Pag. 15 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQExitStatus ArmWithEvents( string StartEventName, string


StopEventName, string RecordEventName)
Description:
Like the Arm method, it executes the system Arm before carrying out an acquisition. The 3 parameters
represent the named software events created by the application and used to start a data acquisition, stop
data acquisition and recording data instead of using the Start, Stop and Record methods of interface.
The software events have the following properties:
• Start event: automatic reset event;
• Stop event: automatic reset event;
• Record event: manual reset event.

Parameters:
StartEventName Automatic reset event for start
StopEventName Automatic reset event for stop
RecordEventName Manual reset event for record
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:

C++ version:
Prototype:
BioDAQExitStatus ArmWithEvents(BSTR StartEventName, BSTR StopEventName,
BSTR RecordEventName)
Parameters:
StartEventName Automatic reset event for start
StopEventName Automatic reset event for stop
RecordEventName Manual reset event for record
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

EREMB-0xxxx-0x Pag. 16 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.1.9 ApplyConfig
Prototype:
BioDAQExitStatus ApplyConfig(PanConfigList configList)
Description:
This method modifies the configuration of BM connected to the system acting on the frequency of the
wireless network radio channel and the identifier of the network itself. Modification of the configuration
implies an automatic reset cycle of the BM involved in the modification. The configuration parameters of
the PAN are the following:
• RF channel: a byte value between 11 and 26 which represents the IEEE encoding for the ZigBee
channels;
• PAN identifier: any whole 2 byte value;
• Serial: 6 element byte array.
Parameters:
configList PANs configuration list
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
PanConfigList

C++ version:
Prototype:
ExitStatusCode ApplyConfig(IPanConfigListPtr pConfigList)
Parameters:
pConfigList PANs configuration list
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.10 ApplyProfile
Prototype:
BioDAQExitStatus ApplyProfile(SensorIdDictionary sensorsId)

EREMB-0xxxx-0x Pag. 17 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
The method sets the new list of sensors handled by the system. Each BM can manage a maximum number
of 10 sensors.
Parameters:
sensorsId Sensors collection
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
SensorIdDictionary

C++ version:
Prototype:
ExitStatusCode ApplyProfile(ISensorIdDictionaryPtr pSensorsId)
Parameters:
pSensorsId Sensors collection
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.11 ApplyProtocol
Prototype:
BioDAQExitStatus ApplyProtocol(Protocol protocol)
Description:
This method sets the list of channels to be acquired. The protocol is a subset of channels enabled to acquire
data. The protocol must be compatible with the profile currently in use.
The protocol is not saved in the memory of BM; the protocol is lost when BM is disconnected.
Parameters:
protocol Protocol
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation

EREMB-0xxxx-0x Pag. 18 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQExitStatus.InvalidArgument Invalid argument


BioDAQExitStatus.Failure Generic failure

See also:
Protocol

C++ version:
Prototype:
ExitStatusCode ApplyProtocol(IProtocolPtr pProtocol)
Parameters:
pProtocol Protocol
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.12 Attach
Prototype:
BioDAQExitStatus Attach()
Description:
It detects the serial COM port where device is connected and it executes system initialization. It performs
the following operations:
• creation of the drivers related to the selected ports (currently the system can manage only 1 port);
• opening of the port;
• enumeration of the resources present;
• creation of the internal objects.
In the current version only serial port are managed, whether virtual or physical.
Parameters:
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.Failure Generic failure

See also:
Reset

EREMB-0xxxx-0x Pag. 19 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
BioDAQExitStatus Attach()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_Failure Generic failure

5.1.13 BmsView
Prototype:
BMViewList BmsView() {get;}
Description:
It returns a list of objects that represent the BMs. This list cannot be modified. On each element of the list
there is a limited access. Currently, the system handles only one BM.
Parameters:
Function return parameter:
BmsView BMs list

C++ version:
Prototype:
IBMViewListPtr BmsView
IBMViewListPtr GetBmsView()
HRESULT get_BmsView( struct IBMViewList * * pVal )
Parameters:
Function return parameter:
BmsView BMs list (COM interface)

5.1.14 ChannelsView
Prototype:
ChannelsViewList ChannelsView() {get;}
Description:
It returns a list of objects that represent the Channels. This list cannot be modified. On each element of the
list there is a limited access.
Parameters:

EREMB-0xxxx-0x Pag. 20 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


ChannelsView Channels list

C++ version:
Prototype:
IChannelsViewListPtr ChannelsView
IChannelsViewListPtr GetChannelsView()
HRESULT get_ChannelsView( struct IChannelViewList * * pVal )
Parameters:
Function return parameter:
ChannelsView Channels list (COM interface)

5.1.15 Download
Prototype:
BioDAQExitStatus DownLoad()
Description:
Starts download data.
Method reserved for recent hardware version of system (BM and EMG probes).
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

See also:
DownLoadAbort

C++ version:
Prototype:
BioDAQExitStatus DownLoad()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation

EREMB-0xxxx-0x Pag. 21 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQExitStatus_InvalidArgument Invalid argument


BioDAQExitStatus_Failure Generic failure

5.1.16 DownloadAbort
Prototype:
BioDAQExitStatus DownLoadAbort()
Description:
Abort the download data.
Method reserved for recent harware version of system (BM and EMG probes).
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

See also:
DownLoad

C++ version:
Prototype:
BioDAQExitStatus DownLoadAbort()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.17 GetLastError
Prototype:
BioDAQErrors GetLastError()
Description:
It returns the last error which occurred in the system.
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 22 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQErrors BioDAQ error code

C++ version:
Prototype:
BioDAQErrors GetLastError()
Parameters:
Function return parameter:
BioDAQErrors BioDAQ error code

5.1.18 Init
Prototype:
BioDAQExitStatus Init(PortList Ports)
Description:
It executes system initialization. It performs the following operations:
• creation of the drivers related to the selected ports (currently the system can manage only 1 port);
• opening of the port;
• enumeration of the resources present;
• creation of the internal objects.
In the current version only serial port are managed, whether virtual or physical.
Parameters:
Ports Ports list
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
PortList
Reset

C++ version:
Prototype:
BioDAQExitStatus Init(IPortsListPtr pPorts)

EREMB-0xxxx-0x Pag. 23 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
pPorts Port lists
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.19 Ports
Prototype:
PortList Ports()
Description:
It returns a list of ports managed by the system. In the current version the list contains only one serial port.
Parameters:
Function return parameter:
Ports List of ports

C++ version:
Prototype:
PortList Ports()
Parameters:
Function return parameter:
Ports List of ports

5.1.20 Record
Prototype:
BioDAQExitStatus Record()
Description:
Starts the data recording.
Parameters:
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation

EREMB-0xxxx-0x Pag. 24 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQExitStatus.InvalidArgument Invalid argument


BioDAQExitStatus.Failure Generic failure

See also:
Start
Stop

C++ version:
Prototype:
BioDAQExitStatus Record ()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.21 Reset
Prototype:
BioDAQExitStatus Reset()
Description:
It executes a reset of system, closing any open ports and freeing up all the occupied resources.
Parameters:
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
Init

C++ version:
Prototype:
BioDAQExitStatus Reset ()

EREMB-0xxxx-0x Pag. 25 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.22 SensorsView
Prototype:
SensorsViewDictionary SensorsView() {get;}
Description:
It returns a list of objects that represent the sensors. The list cannot be modified. On each element of the
list there is a limited access.
Parameters:
Function return parameter:
SensorsView Sensors list

C++ version:
Prototype:
ISensorViewDictionaryPtr SensorsView
ISensorViewDictionaryPtr GetSensorsView()
HRESULT get_SensorsView( struct ISensorViewDictionary * * pVal )
Parameters:
Function return parameter:
SensorsView Sensors list (COM interface)

5.1.23 Sinks
Prototype:
DataSinkList Sinks() {get;}
Description:
It returns a list of objects that represent the sinks. This list can be modified adding or removing elements.
Parameters:
Function return parameter:
Sinks Sinks list

EREMB-0xxxx-0x Pag. 26 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
IDataSinkListPtr Sinks
IDataSinkListPtr GetSinks()
HRESULT get_Sinks( struct IDataSinkList * * pVal )
Parameters:
Function return parameter:
Sinks Sinks list (COM interface)

5.1.24 SinksFactory
TODO

5.1.25 Start
Prototype:
BioDAQExitStatus Start()
Description:
Start an acquisition.
Parameters:
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
Stop

C++ version:
Prototype:
BioDAQExitStatus Start ()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation

EREMB-0xxxx-0x Pag. 27 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQExitStatus_InvalidArgument Invalid argument


BioDAQExitStatus_Failure Generic failure

5.1.26 StartInMemoryMode
Prototype:
BioDAQExitStatus StartInMemoryMode()
Description:
Start an acquisition. The data are also stored in the memory of EMG probes, if necessary; the stored data
are available for the download operation.
Method reserved for recent hardware version (firmware version of EMG probes with build number >31).
Parameters:
Function return paramater:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
Stop

C++ version:
Prototype:
BioDAQExitStatus StartinMemoryMode ()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.27 Stop
Prototype:
BioDAQExitStatus Stop()
Description:
Stop the acquisition.
Parameters:

EREMB-0xxxx-0x Pag. 28 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:
Start

C++ version:
Prototype:
BioDAQExitStatus Stop ()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.28 Trigger
Prototype:
BioDAQExitStatus Trigger( TriggerSource triggerSource )
Description:
Method currently not implemented. Only the Software type TriggerSource is settable (default trigger type).
Parameters:
triggerSource TODO
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:

EREMB-0xxxx-0x Pag. 29 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
BioDAQExitStatus Trigger( TriggerSource triggerSource )
Parameters:
triggerSource TODO
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument
BioDAQExitStatus_Failure Generic failure

5.1.29 UpdateStatusInfo
Prototype:
BioDAQExitStatus UpdateStatusInfo()
Description:
It executes the state information update relative to the BM and the sensors forcing a hardware reading
from each BM. This information can be consulted directly from the properties of each BM, sensor or
channel belonging to the BioDAQ lists.
Parameters:
Function return parameter:
BioDAQExitStatus.Success Success
BioDAQExitStatus.InvalidOperation Invalid operation
BioDAQExitStatus.InvalidArgument Invalid argument
BioDAQExitStatus.Failure Generic failure

See also:

C++ version:
Prototype:
BioDAQExitStatus UpdateStatusInfo()
Parameters:
Function return parameter:
BioDAQExitStatus_Success Success
BioDAQExitStatus_InvalidOperation Invalid operation
BioDAQExitStatus_InvalidArgument Invalid argument

EREMB-0xxxx-0x Pag. 30 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQExitStatus_Failure Generic failure

5.2 BioDAQStateChangedEventArgs interface


The interface collects the information of controller when a state change happens.
See StateChanged interface for further details.

5.2.1 OldValue
Prototype:
BioDAQState OldValue() {get;}
Description:
It returns the previous state of the BioDAQ controller.
Parameters:
Function return parameter:
OldValue Previous state of controller

C++ version:
Prototype:
BioDAQState OldValue
BioDAQState OldValue()
Parameters:
Function return parameter:
OldValue Previous state of controller

5.2.2 NewValue
Prototype:
BioDAQState NewValue() {get;}
Description:
It returns the actual state of the BioDAQ controller.
Parameters:
Function return parameter:
NewValue State of controller

C++ version:
Prototype:

EREMB-0xxxx-0x Pag. 31 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BioDAQState NewValue
BioDAQState NewValue()
Parameters:
Function return parameter:
NewValue State of controller

5.3 BeginDownLoad interface


This outgoing interface handles the begin download data event.

5.3.1 BeginDownLoadEventHandler
Call back function to manage the BeginDownLoad event.
Prototype:
delegate void BeginDownLoadEventHandler(object sender,
BeginDownLoadEventArgs eventArgs)
Description:
Delegate for BeginDownLoad event.
Parameters:
sender Source of event
eventArgs Instance containing information about the event
Function return parameter:
See also:
BeginDownLoadEventArgs interface

C++ version:

5.4 BeginDownLoadEventArgs interface


This interface collects information when the BeginDownLoad event is raised.
See BeginDownLoad interface for further details.

5.5 EndDownLoad interface


This outgoing interface handles the end download data event.

EREMB-0xxxx-0x Pag. 32 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.5.1 EndDownLoadEventHandler
Call back function to manage the EndDownLoad event.
Prototype:
delegate void EndDownLoadEventHandler(object sender, EndDownLoadEventArgs
eventArgs)
Description:
Delegate for EndDownLoad event.
Parameters:
sender Source of event
eventArgs Instance containing information about the event
Function return parameter:
See also:
EndDownLoadEventArgs interface

C++ version:

5.6 EndDownLoadEventArgs interface


This interface collects information when the EndDownLoad event is raised.
See EndDownLoad interface for further details.

5.6.1 State
Prototype:
BioDAQDownloadStatus State() {get;}
Description:
It returns the download data operation status.
Parameters:
Function return parameter:
State State of download operation

C++ version:
Prototype:
BioDAQDownloadStatus State
BioDAQDownloadStatus State()
Parameters:

EREMB-0xxxx-0x Pag. 33 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


State State of download operation

5.7 ProgressDownLoad interface


This outgoing interface handles the progress download data event. The event is raised 4 times during the
download, when:
• 20% of data stored in the on‐board of EMG probes, is downloaded;
• 40% of data stored in the on‐board of EMG probes, is downloaded;
• 60% of data stored in the on‐board of EMG probes, is downloaded;
• 80% of data stored in the on‐board of EMG probes, is downloaded.

5.7.1 ProgressDownLoadEventHandler
Call back function to manage the ProgressDownLoad event.
Prototype:
delegate void ProgressDownLoadEventHandler(object sender,
ProgressDownLoadEventArgs eventArgs)
Description:
Delegate for ProgressDownLoad event.
Parameters:
sender Source of event
eventArgs Instance containing information about the event
Function return parameter:
See also:
ProgressDownLoadEventArgs interface

C++ version:
Prototype:
HRESULT ProgressDownLoad ( const _variant_t & sender, struct
IProgressDownLoadEventArgs * eventArgs )
virtual HRESULT __stdcall raw_ProgressDownLoad(VARIANT sender,
bts_biodaq_core::IProgressDownLoadEventArgs * eventArgs)
Parameters:
sender Oggetto sorgente dell’evento
eventArgs Istanza contenente informazioni sull’evento di download in
progressione
Function return parameter:

EREMB-0xxxx-0x Pag. 34 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.8 ProgressDownLoadEventArgs interface


This interface collects information of the download process, when the ProgressDownLoad event is raised.
See ProgressDownLoad interface for further details.

5.8.1 ProgressPercentage
Prototype:
Percent ProgressPercentage() {get;}
Description:
It returns the percentage of downloaded data.
Parameters:
Function return parameter:
ProgressPercentage Percentage code

C++ version:
Prototype:
Percent ProgressPercentage
Percent GetProgressPercentage()
HRESULT get_ProgressPercentage(Percent * pVal)
Parameters:
Function return parameter:
pVal Percentage code

5.9 BMView interface


The interface permits to retireve the information about the BM. The BM creates the wireless network
where BTS sensors are connected. The PAN has two configuration parameters:
• RF channel,
• PAN identifier (PANId).
Each BM is associated to one and only one PAN.
For the actual version of system the maximum numbers of connected BM is equal to 1.

5.9.1 Sensor signal latency codes


The table contains the sensor signal latency codes:

EREMB-0xxxx-0x Pag. 35 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Codes Value Description


HWDefined 255 Hardware settings (NOT developed)
Latency50ms 0 Latency 50 ms.
Latency60ms 1 Latency 60 ms.
Latency70ms 2 Latency 70 ms.
This information is not supported in the actual version of system.

5.9.2 BM state codes


The table contains the state code for the BM:
State Description
Ready BM is ready to operate.
Error BM entered in an irreversible error state.

5.9.3 BM channel type codes


The table contains the codes for the type of BM:
State Description
NDEF Undefined type.
BM BM with serial interface (the only device in use).

5.9.4 Platform IDs codes for BM


The table contains the codes for the platform identification of BM:
Codes Description
NDEF TODO
EVB TODO
BM TODO
This information is not supported in the actual version of system.

5.9.5 DataPacketSize
Prototype:
int DataPacketSize() {get;}
Description:

EREMB-0xxxx-0x Pag. 36 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

It returns the data packet size (data + header). Packet size is sent from the sensors and it is handled by the
BM (number of samples).
Parameters:
Function return parameter:
DataPacketSize Data packet size

C++ version:
Prototype:
long DataPacketSize
long GetDataPacketSize()
HRESULT get_DataPacketSize( long * pVal )
Parameters:
Function return parameter:
DataPacketSize Data packet size

5.9.6 Device
Prototype:
BMType Device() {get;}
Description:
TODO.
Parameters:
Function return parameter:
Device TODO

C++ version:
Prototype:
BMType Device
BMType GetDevice()
HRESULT get_Device( BMType * pVal )
Parameters:
Function return parameter:
Device TODO

5.9.7 FWVersion
Prototype:

EREMB-0xxxx-0x Pag. 37 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Version FWVersion() {get;}


Description:
It returns the firmware version loaded in the BM.
Parameters:
Function return parameter:
FWVersion Version data structure (library version 0.0.0.0)

C++ version:
Prototype:
mscorlib::_VersionPtr FWVersion
mscorlib::_VersionPtr GetFWVersion()
HRESULT get_FWVersion( struct mscorlib::_Version * * pVal )
Parameters:
Function return parameter:
FWVersion TODO

5.9.8 Latency
Prototype:
SignalLatency Latency() {get;}
Description:
Property NOT implemented.
Parameters:
Function return parameter:
Latency TODO

C++ version:
Prototype:
SignalLatency Latency
SignalLatency GetLatency()
HRESULT get_Latency( SignalLatency * pVal )
Parameters:
Function return parameter:
Latency TODO

5.9.9 PANId
Prototype:

EREMB-0xxxx-0x Pag. 38 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

uint PANId() {get;}


Description:
It returns the PAN Identifier of the wireless network related to the BM.
Parameters:
Function return parameter:
PANId PAN Identifier

C++ version:
Prototype:
unsigned long PANId
unsigned long GetPANId()
HRESULT get_PANId( unsigned long * pVal )
Parameters:
Function return parameter:
PANId PAN Identifier

5.9.10 PacketSamples
Prototype:
int PacketSamples() {get; set;}
Description:
It returns/sets the number of samples per packet.
The number of samples per packet affects the data coding for EMG probes.
Only a range of values are admitted according to the coding type for EMG probes. For ADPCM code type
the value must be satisfied by the following conditions:
• value must be greater than 19 and smaller than 101;
• value must be odd.
For Raw code type the value must be satisfied by the following conditions:
• value must be greater than 10 and smaller than 62;
• value multiplied for (3/2) must be an integer value.
The number of samples per packet does not affect the data coding for AUX probes, AUX_EGN probes and
AUX_FSW probes.

Parameters:
Function return parameter:
PacketSamples Number of samples per packet

EREMB-0xxxx-0x Pag. 39 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
long PacketSamples
long GetPacketSamples()
HRESULT get_PacketSamples( long * pVal )
Parameters:
Function return parameter:
PacketSamples Number of samples per packet

Prototype:
long PacketSamples
void PutPacketSamples( long newValue )
HRESULT putref_PacketSamples( long newValue )

Parameters:
newValue Number of samples per packet
Function return parameter:

5.9.11 PlatId
Prototype:
BMPlatform PlatId() {get;}
Description:
Property NOT implemented.
Parameters:
Function return parameter:
PlatId TODO

C++ version:
Prototype:
BMPlatform PlatId
BMPlatform GetPlatId()
HRESULT get_PlatId( BMPlatform * pVal )
Parameters:
Function return parameter:
PlatId TODO

EREMB-0xxxx-0x Pag. 40 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.9.12 RFCh
Prototype:
byte RFChan() {get;}
Description:
It returns the wireless network radio channel related to the BM.
Parameters:
Function return parameter:
RFChan RF channel

C++ version:
Prototype:
unsigned char RFChan
unsigned char GetRFChan()
HRESULT get_RFChan( unsigned char * pVal )
Parameters:
Function return parameter:
RFChan RF channel

5.9.13 SensorsMask
Prototype:
byte SensorsMask() {get; set;}
Description:
It returns/sets the sensors mask which are connected to the BM and are enabled to acquire data. ‘1’‐bit
value in the mask means i‐th sensor is connected. This property is used only with simulated data mode.
Parameters:
Function return parameter:
SensorsMask Sensors mask for connection status

C++ version:
Prototype:
unsigned char SensorsMask
unsigned char GetSensorsMask()
HRESULT get_SensorsMask( unsigned char * pVal )

EREMB-0xxxx-0x Pag. 41 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
SensorsMask Sensors mask for connection status

Prototype:
unsigned char SensorsMask
void PutSensorsMask( unsigned char newValue )
HRESULT putref_SensorsMask( unsigned char newValue )
Parameters:
newValue Sensors mask for connection status
Function return parameter:

5.9.14 Serial
Prototype:
Byte[] Serial() {get;}
Description:
It returns the identifier of BM. It is a 6 byte array.
Parameters:
Function return parameter:
Serial BM serial identifier

C++ version:
Prototype:
SAFEARRAY * Serial
SAFEARRAY * GetSerial()
HRESULT get_Serial( SAFEARRAY * * pVal )
Parameters:
Function return parameter:
GetSerial BM serial identifier

5.9.15 SerialHex
Prototype:
string SerialHex() {get;}
Description:
It returns the identifier of BM. It is a hexadecimal string.

EREMB-0xxxx-0x Pag. 42 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
Serial BM serial identifier (hexadecimal string)

C++ version:
Prototype:
_bstr_t Serial
_bstr_t GetSerial()
HRESULT get_Serial( BSTR * pVal )
Parameters:
Function return parameter:
GetSerial BM serial identifier (hexadecimal string)

5.9.16 Sim
Prototype:
bool Sim() {get; set;}
Description:
It returns/sets a value indicating if acquired data are simulated.
Parameters:
Function return parameter:
True Data are simulated
False Data are not simulated

C++ version:
Prototype:
VARIANT_BOOL Sim
VARIANT_BOOL GetSim()
HRESULT get_Sim( VARIANT_BOOL * pVal )
Parameters:
Function return parameter:
VARIANT_TRUE Data are simulated
VARIANT_FALSE Data are not simulated

Prototype:

EREMB-0xxxx-0x Pag. 43 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

VARIANT_BOOL Sim
void PutSim( VARIANT_BOOL newValue )
HRESULT putref_Sim( VARIANT_BOOL newValue )
Parameters:
newValue VARIANT_TRUE if data are simulated
Function return parameter:

5.9.17 SimPacketSamples
Prototype:
int SimPacketSamples() {get; set;}
Description:
It returns/sets the number of samples per packet for simulated data.
Parameters:
Function return parameter:
SimPacketSamples Number of samples per packet

C++ version:
Prototype:
long SimPacketSamples
long GetSimPacketSamples()
HRESULT get_SimPacketSamples( long * pVal )
Parameters:
Function return parameter:
SimPacketSamples Number of samples per packet

Prototype:
long SimPacketSamples
void PutSimPacketSamples( long newValue )
HRESULT putref_SimPacketSamples( long newValue )

Parameters:
newValue Number of samples per packet
Function return parameter:

EREMB-0xxxx-0x Pag. 44 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.9.18 State
Prototype:
BMState State() {get;}
Description:
It returns the state of BM.
Parameters:
Function return parameter:
State BM state

C++ version:
Prototype:
BMState State
BMState GetState()
HRESULT get_State( BMState * pVal )
Parameters:
Function return parameter:
State BM state

5.10 BMView list interface


This interface accesses to the BMView elements of the list.

5.10.1 Contains
Prototype:
bool Contains(BMView bm)
Description:
True if list contains the given BM.
Parameters:
bm BM
Function return parameter:
True BM belongs to the list
False BM does not belong to the list

EREMB-0xxxx-0x Pag. 45 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
VARIANT_BOOL Contains( struct IBMView * bm )
Parameters:
bm BM

Function return parameter:


VARIANT_TRUE BM belongs to the list
VARIANT_FALSE BM does not belong to the list

5.10.2 Count
Prototype:
int Count() {get;}
Description:
It returns the number of BMs in the list.
Parameters:
Function return parameter:
Count Number of elements

C++ version:
Prototype:
long Count
long GetCount()
HRESULT get_Count( long * pVal )
Parameters:
Function return parameter:
Count Number of elements

5.10.3 IndexOf
Prototype:
int IndexOf(BMView bm)
Description:
It returns the index where the given BM is stored in the list.
Parameters:
bm BM

EREMB-0xxxx-0x Pag. 46 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


IndexOf Index in the list

C++ version:
Prototype:
long IndexOf( struct IBMView * bm )
Parameters:
bm BM
Function return parameter:
IndexOf Index in the list

5.10.4 This[index]
Prototype:
BMView This[int index] {get;}
Description:
It returns the BM specified by the given index.
Parameters:
index Index in the list
Function return parameter:
BMView BM

C++ version:
Prototype:
IBMViewPtr Item[]
IBMViewPtr GetItem( long index )
HRESULT get_Item( long index, struct IBMView * * pVal )
Parameters:
index Index in the list
pVal BM
Function return parameter:
GetItem BM

EREMB-0xxxx-0x Pag. 47 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.11 Channel interface


The interface retrieves information of the channel. The channel is a logical data structure related to a
sensor. The data are acquired for every configurated channel. For each sensor type the number of channels
varies according to the following:
• EMG sensor: 1 channel (EMG mode);
• AUX sensor: 2 channels in EGN mode, 4 channels in FSW mode;
• AUXEGN sensor: 2 channels (EGN mode);
• AUXFSW sensor: 4 channels (FSW mode).
The Channel interface is a base interface. The IChannelEMG, IChannelEGN and IChannelFSW interfaces
derive from IChannel base interface. The IChannel interface permits to get information about the analog‐to‐
digital conversion; the interface permits to change the index of channel (associated to protocol item) inside
the current protocol.

5.11.1 Channel type codes


The table contains the types of channel:
Types Value Description
Undefined ‐1 Undefined type.
EMG 0 EMG channel type.
EGN 1 EGN channel type.
FSW 2 FSW channel type.

5.11.2 Measuring units codes


The table contains the measuring units codes for the channels:
Codes Value Description
nDef 0 Measuring unit NOT defined.
mVolts 1 Measuring unit: mV.
Reserved for EMG channels, FSW channels.
deg 2 Measuring unit: deg.
Reserved for EGN channels.

5.11.3 EMG channel range codes


The table contains the value ranges for EMG channels:
Codes Value Description
HWDefined 255 TODO

EREMB-0xxxx-0x Pag. 48 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Gain6_0mV 1 EMG values in ±6.0 mV.


Gain3_0mV 2 EMG values in ±3.0 mV.
Gain1_5mV 3 EMG values in ±1.5 mV.

5.11.4 EGN channel range codes


The table contains the value ranges for EGN channels:
Codes Value Description
Gain600deg 1 EGN values in ±600 deg

5.11.5 Sampling rate codes


The table contains sampling rate codes for EMG sensors:
Codes Value Description
HWDefined 255 TODO
Rate1kHz 0 Sampling frequency is 1kHz.
Rate100Hz 5 Sampling frequency is 100Hz (NOT implemented).
The sampling frequency for AUX sensors, AUXEGN sensors and AUXFSW sensors is fixed to 100 Hz.

5.11.1 Active
Prototype:
bool Active {get;}
Description:
True if channel is active for data acquisition.
Parameters:
Function return parameter:
Active True if channel is active to acquire data

C++ version:
Prototype:
VARIANT_BOOL Active
VARIANT_BOOL GetActive()
HRESULT get_Active( VARIANT_BOOL * pVal )
Parameters:

EREMB-0xxxx-0x Pag. 49 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


pVal VARIANT_TRUE if channel is active to acquire data

5.11.2 Coding
Prototype:
CodingType Coding {get;}
Description:
It returns the coding type. See coding types codes in SensorView interface.
Parameters:
Function return parameter:
Coding Coding type

C++ version:
Prototype:
CodingType Coding
CodingType GetCoding()
HRESULT get_CodingType( CodingType * pVal )
Parameters:
Function return parameter:
pVal Coding type

5.11.3 ConversionFactor
Prototype:
float ConversionFactor {get;}
Description:
It returns the conversion factor. This value converts the digital data value in the float value. The conversion
factor is related to the analog‐to‐digital converter. The conversion factor varies according to the channel
type.
Parameters:
Function return parameter:
ConversionFactor Conversion factor

C++ version:
Prototype:

EREMB-0xxxx-0x Pag. 50 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

float ConversionFactor
float GetConversionFactor()
HRESULT get_ConversionFactor( float * pVal )
Parameters:
Function return parameter:
pVal Conversion factor

5.11.4 DecimationFactor
Prototype:
int DecimationFactor {get;}
Description:
It returns the decimation factor. TODO
Parameters:
Function return parameter:
DecimationFactor Decimation factor

C++ version:
Prototype:
long DecimationFactor
long GetDecimationFactor()
HRESULT get_DecimationFactor( long * pVal )
Parameters:
Function return parameter:
pVal Decimation factor

5.11.5 LogicZero
Prototype:
int LogicZero {get;}
Description:
It returns the logic offset value related to the analog‐to‐digital converter. This value converts the digital
data value in the float value.
Parameters:
Function return parameter:
LogicZero Zero offset

EREMB-0xxxx-0x Pag. 51 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
long LogicZero
long GetLogicZero()
HRESULT get_LogicZero( long * pVal )
Parameters:
Function return parameter:
pVal Zero offset

5.11.6 ProtocolChannelIndex
Prototype:
int ProtocolChannelIndex() {get; set;}
Description:
It returns/sets the index of channel inside the active protocol.
Parameters:
Function return parameter:
ProtocolChannelIndex Index of channel in the protocol

C++ version:
Prototype:
long ProtocolChannelIndex
long GetProtocolChannelIndex()
HRESULT get_ProtocolChannelIndex( long * pVal )
Parameters:
Function return parameter:
pVal Index of channel in the protocol

Prototype:
long ProtocolChannelIndex
void PutProtocolChannelIndex( long newValue )
HRESULT putref_ProtocolChannelIndex( long newVal )
Parameters:
newValue Index of channel in the protocol
Function return parameter:

EREMB-0xxxx-0x Pag. 52 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.11.7 SamplingRate
Prototype:
SamplingRate SamplingRate {get;}
Description:
It returns the sampling rate code. The sampling frequency is referred to the EMG sensors; AUX sensors,
AUXEGN sensors and AUXFSW sensors works at fixed 100 Hz.
Parameters:
Function return parameter:
SamplingRate Sampling rate code

C++ version:
Prototype:
SamplingRate SamplingRate
SamplingRate GetSamplingRate()
HRESULT get_SamplingRate( SamplingRate * pVal )
Parameters:
Function return parameter:
pVal Sampling rate code

5.11.8 Type
Prototype:
ChannelType Type {get;}
Description:
It returns the channel type.
Parameters:
Function return parameter:
Type Channel type

C++ version:
Prototype:
ChannelType Type
ChannelType GetType()
HRESULT get_Type( ChannelType * pVal )

EREMB-0xxxx-0x Pag. 53 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
pVal Channel type

5.12 ChannelEMG interface


This interface permits to retrieve information from EMG channel.

5.12.1 ChannelRangeCode
Prototype:
EMGChannelRangeCodes ChannelRangeCode {get;}
Description:
It returns channel range code for EMG channel.
Parameters:
Function return parameter:
ChannelRangeCode Range code

C++ version:
Prototype:
EMGChannelRangeCodes ChannelRangeCode
EMGChannelRangeCodes GetChannelRangeCode()
HRESULT get_ChannelRangeCode ( EMGChannelRangeCodes * pVal )
Parameters:
Function return parameter:
pVal Range code

5.12.2 Compression
Prototype:
bool Compression {get;}
Description:
True if data of EMG sensors are compressed in the transmission. This parameter defines the coding type of
EMG channel.
Parameters:
Function return parameter:
Compression True if compression is enabled

EREMB-0xxxx-0x Pag. 54 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
VARIANT_BOOL Compression
VARIANT_BOOL GetCompression()
HRESULT get_Compression ( VARIANT_BOOL * pVal )
Parameters:
Function return parameter:
pVal True if compression is enabled

5.12.3 LowPassCutOff
Prototype:
int LowPassCutOff {get;}
Description:
It returns the cut‐off frequency [Hz] of low pass filter used in the envelope mode.
Parameters:
Function return parameter:
LowPassCutOff Cut‐off frequency [Hz]

C++ version:
Prototype:
long LowPassCutOff
long GetLowPassCutOff()
HRESULT get_LowPassCutOff ( long * pVal )
Parameters:
Function return parameter:
pVal Cut‐off frequency [Hz]

5.12.4 SignalRange
Prototype:
float SignalRange {get;}
Description:
It returns the float value related to the range code of EMG channel.

EREMB-0xxxx-0x Pag. 55 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
SignalRange Float value represents range code of EMG channel

C++ version:
Prototype:
float SignalRange
float GetSignalRange()
HRESULT get_SignalRange( float * pVal )
Parameters:
Function return parameter:
pVal Float value represents range code of EMG channel

5.12.5 Units
Prototype:
MeasuringUnits Units {get;}
Description:
It returns the measuring unit related to the EMG channel.
Parameters:
Function return parameter:
Units Measuring unit of EMG channel

C++ version:
Prototype:
MeasuringUnits Units
MeasuringUnits GetUnits()
HRESULT get_Units( MeasuringUnits * pVal )
Parameters:
Function return parameter:
pVal Measuring unit of EMG channel

5.13 ChannelEGN interface


This interface permits to retrieve information from EGN channel.

EREMB-0xxxx-0x Pag. 56 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.13.1 ChannelRangeCode
Prototype:
EGNChannelRangeCodes ChannelRangeCode {get;}
Description:
It returns channel range code for EGN channel.
Parameters:
Function return parameter:
ChannelRangeCode Range code

C++ version:
Prototype:
EGNChannelRangeCodes ChannelRangeCode
EGNChannelRangeCodes GetChannelRangeCode()
HRESULT get_ChannelRangeCode( EGNChannelRangeCodes * pVal )
Parameters:
Function return parameter:
pVal Range code

5.13.2 SignalRange
Prototype:
float SignalRange {get;}
Description:
It returns the float value related to the range code of EGN channel.
Parameters:
Function return parameter:
SignalRange Float value represents range code of EGN channel

C++ version:
Prototype:
float SignalRange
float GetSignalRange()
HRESULT get_SignalRange( float * pVal )
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 57 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

pVal Float value represents range code of EGN channel

5.13.3 Units
Prototype:
MeasuringUnits Units {get;}
Description:
It returns the measuring unit related to the EGN channel.
Parameters:
Function return parameter:
Units Measuring unit of EGN channel

C++ version:
Prototype:
MeasuringUnits Units
MeasuringUnits GetUnits()
HRESULT get_Units ( MeasuringUnits * pVal )
Parameters:
Function return parameter:
pVal Measuring unit of EGN channel

5.14 ChannelFSW interface


This interface permits to retrieve information from FSW channel.

5.14.1 Units
Prototype:
MeasuringUnits Units {get;}
Description:
It returns the measuring unit related to the FSW channel.
Parameters:
Function return parameter:
Units Measuring unit of FSW channel

EREMB-0xxxx-0x Pag. 58 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
MeasuringUnits Units
MeasuringUnits GetUnits()
HRESULT get_Units( MeasuringUnits * pVal )
Parameters:
Function return parameter:
pVal Measuring unit of FSW channel

5.15 ChannelViewList interface


This interface accesses to the Channel elements of the list. The interface permits to set properties for the
EMG channels. The properties for EMG channels are: the coding type, the range code and sampling rate.
The coding type for EMG channels admits the following:
• raw coding without compression;
• raw coding with compression: data are transmitted with ADPCM code.
The coding type for EGN channels is raw without compression. The coding type for FSW channels is raw
without compression.

5.15.1 Contains
Prototype:
bool Contains(Channel channel)
Description:
It returns True if given channel belongs to the list.
Parameters:
channel Channel
Function return parameter:
True Channel belongs to the list
False Channel does not belong to the list

C++ version:
Prototype:
VARIANT_BOOL Contains( struct IChannel * channel )
Parameters:

EREMB-0xxxx-0x Pag. 59 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

channel Channel

Function return parameter:


VARIANT_TRUE Channel belongs to the list
VARIANT_FALSE Channel does not belong to the list

5.15.2 Count
Prototype:
int Count() {get;}
Description:
It returns the number of channels in the list.
Parameters:
Function return parameter:
Count Number of channels

C++ version:
Prototype:
long Count
long GetCount()
HRESULT get_Count( long * pVal )
Parameters:
Function return parameter:
pVal Number of channels

5.15.3 GetEnumerator
Prototype:
IEnumerator GetEnumerator()
Description:
It returns the IEnumerator interface related to the list of channels. The IEnumerator interface permits to
access elements of list. See Microsoft MSDN for a detailed definition on IEnumerator interface.
Parameters:
Function return parameter:
GetEnumerator IEnumerator interface

EREMB-0xxxx-0x Pag. 60 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
IEnumVARIANTPtr GetEnumerator()
Parameters:
Function return parameter:
GetEnumerator IEnumerator interface

5.15.4 IndexOf
Prototype:
int IndexOf(Channel channel)
Description:
It returns the index where the given channel is stored in the list.
Parameters:
channel Channel
Function return parameter:
IndexOf Index in the list

C++ version:
Prototype:
long IndexOf( struct IChannel * channel )
Parameters:
channel Channel
Function return parameter:
IndexOf Index in the list

5.15.5 SetEMGChannelsCodingType
Prototype:
bool SetEMGChannelsCodingType( CodingType coding )
Description:
It sets the coding type for EMG channels belonging to the list.
Parameters:
coding Coding type
Function return parameter:

EREMB-0xxxx-0x Pag. 61 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

True Success
False Failed

C++ version:
Prototype:
VARIANT_BOOL SetEMGChannelsCodingType( CodingType coding )
Parameters:
coding Coding type
Function return parameter:
VARIANT_TRUE Success
VARIANT_FALSE Failed

5.15.6 SetEMGChannelsCompression
Prototype:
bool SetEMGChannelsCompression( bool compression )
Description:
It sets the compression for data transmission of EMG channels.
Parameters:
compression TRUE if compression is enabled
Function return parameter:
True Success
False Failed

C++ version:
Prototype:
VARIANT_BOOL SetEMGChannelsCompression( VARIANT_BOOL compression )
Parameters:
compression TRUE if compression is enabled
Function return parameter:
VARIANT_TRUE Success
VARIANT_FALSE Failed

EREMB-0xxxx-0x Pag. 62 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.15.7 SetEMGChannelsHPFilterEnabling
Prototype:
bool SetEMGChannelsHPFilterEnabling( bool bEnabled )
Description:
It enables the HP filter for EMG channels. The implemented filter is a FIR high pass filter (frequency cut‐off
fc = 10 Hz, delay dT = 49 ms with sampling frequency of 1 kHz).
Parameters:
bEnabled True if HP filter is enabled
Function return parameter:
True Success

C++ version:
Prototype:
VARIANT_BOOL SetEMGChannelsHPFilterEnabling (VARIANT_BOOL bEnabled )
Parameters:
bEnabled VARIANT_TRUE if HP filter is enabled
Function return parameter:
VARIANT_TRUE Success

5.15.8 SetEMGChannelsLowPassCutOff
Prototype:
bool SetEMGChannelsLowPassCutOff( int lowpassCutOff )
Description:
It sets the cut‐off frequency for the data acquisition in envelope mode for EMG channels.
Parameters:
lowpassCutOff Cut‐off frequency
Function return parameter:
True Success
False Failed

C++ version:
Prototype:
VARIANT_BOOL SetEMGChannelsLowPassCutOff ( long lowpassCutOff )
Parameters:

EREMB-0xxxx-0x Pag. 63 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

lowpassCutOff Cut‐off frequency


Function return parameter:
VARIANT_TRUE Success
VARIANT_FALSE Failed

5.15.9 SetEMGChannelsRangeCode
Prototype:
bool SetEMGChannelsRangeCode( EMGChannelRangeCodes rangeCode )
Description:
It sets the range code for data acquisition of EMG channels.
Parameters:
rangeCode Range code
Function return parameter:
True Success
False Failed

C++ version:
Prototype:
VARIANT_BOOL SetEMGChannelsRangeCode ( EMGChannelRangeCodes rangeCode )
Parameters:
rangeCode Range code
Function return parameter:
VARIANT_TRUE Success
VARIANT_FALSE Failed

5.15.10 SetEMGChannelsSamplingRate
Prototype:
bool SetEMGChannelsSamplingRate( SamplingRate samplingRate )
Description:
It sets the sampling rate for EMG channels.
Parameters:
samplingRate Sampling rate code
Function return parameter:
True Success

EREMB-0xxxx-0x Pag. 64 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

False Failed

C++ version:
Prototype:
VARIANT_BOOL SetEMGChannelsSamplingRate ( SamplingRate samplingRate )
Parameters:
samplingRate Sampling rate code
Function return parameter:
VARIANT_TRUE Success
VARIANT_FALSE Failed

5.15.11 This[index]
Prototype:
IChannel This[int index] {get;}
Description:
It returns the Channel specified by the given index.
Parameters:
index Index in the list
Function return parameter:
IChannel Channel

C++ version:
Prototype:
IChannelPtr Item[]
IChannelPtr GetItem( long index )
HRESULT get_Item ( long index, struct IChannel * * pVal )
Parameters:
index Index in the list
pVal Channel
Function return parameter:
GetItem Channel

EREMB-0xxxx-0x Pag. 65 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.16 CommandBase interface (?)


TODO….

5.16.1 Trigger source IDs codes


The table contains trigger sources IDs codes. The system handles software trigger events to acquire data
and to record data. Hardware trigger events to handle acquisition data and recording data are NOT
available for the actual version of software.
Error type Value Description
Hardware 0 Hardware trigger (NOT implemented).
Software 1 Software trigger.

5.17 DataSink interface


The interface is a base interface for the sink objects. The interface permits the initialization of the sink, the
start and the stop data acquisition and the release of resources. The QueueSink, MathSink and DiskSink
interfaces derived from this base interface. When a sink is added to the list of sinks handled by the BioDAQ
interface it is not necessary to call the Arm, Start, Stop and Reset functions for the sink itself: BioDAQ
interface handles the sinks properly without explicit function calls.

5.17.1 Sink exit status codes


The table contains sinks exit status codes for the methods of Sink interface:
Codes Value Description
Success 0 Successful operation.
InvalidArgument 1 Invalid argument.
InvalidOperation 2 Invalid operation.
Error 255 Generic failure.

5.17.2 Sink types codes


The table contains the types of sink:
Types Description
Queue Data are stored in a “Queue” type objects, without real‐time processing.
Disk Data are stored in a binary file in the disk with a custom format.
Math Data are stored in a “Queue” type objects after real‐time processing (see
Processor).
Custom NOT implemented

EREMB-0xxxx-0x Pag. 66 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.17.1 Arm
Prototype:
SinkExitStatus Arm(Protocol protocol)
Description:
It executes an “Arm” of the sink before acquire data. The internal resources of the sink are initialized.
You have not to use this method if you add the sink to the list of datasinks of the controller.
Parameters:
protocol Protocol (channels collection) to acquire
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus Arm( struct IProtocol * protocol )
HRESULT Arm( [in] struct IProtocol * protocol, [out, retval]
SinkExitStatus * pVal )
Parameters:
protocol Protocol (channels collection) to acquire
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.17.2 Init
Prototype:
SinkExitStatus Init()
Description:
It initializes the sink.
You have not to use this method if you add the sink to the list of datasinks of the controller.

EREMB-0xxxx-0x Pag. 67 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus Init()
HRESULT Init( [out, retval] SinkExitStatus * pVal )
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.17.3 Reset
Prototype:
SinkExitStatus Reset()
Description:
It executes a reset of sink.
You have not to use this method if you add the sink to the list of datasinks of the controller.
Parameters:
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

EREMB-0xxxx-0x Pag. 68 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
SinkExitStatus Reset()
HRESULT Reset( [out, retval] SinkExitStatus * pVal )
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.17.4 Start
Prototype:
SinkExitStatus Start()
Description:
It starts the data acquisition/real‐time processing for the sink.
You have not to use this method if you add the sink to the list of datasinks of the controller.
Parameters:
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus Start()
HRESULT Start( [out, retval] SinkExitStatus * pVal )
Parameters:
Function return parameter:
SinkExitStatus_Success Successo
SinkExitStatus_InvalidOperation Operazione non valida

EREMB-0xxxx-0x Pag. 69 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

SinkExitStatus_InvalidArgument Argomento non valido


SinkExitStatus_Error Errore generico

5.17.5 Stop
Prototype:
SinkExitStatus Stop()
Description:
It stops the data acquisition/real‐time processing for the sink.
You have not to use this method if you add the sink to the list of datasinks of the controller.
Parameters:
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus Stop()
HRESULT Stop( [out, retval] SinkExitStatus * pVal )
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.17.6 Write
Prototype:
SinkExitStatus Write( int chIx, long sampleIx, float value )
Description:

EREMB-0xxxx-0x Pag. 70 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

It writes the data value in the sink for the given channel.
You have not to use this method if you add the sink to the list of datasinks of the controller.
Parameters:
chIx Channel index
sampleIx Sample index
value Data value
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus Write( long chIx, __int64 sampleIx, float value )
HRESULT Write( [in] long chIx, [in] __int64 sampleIx, [in] float value,
[out, retval] SinkExitStatus * pVal )
Parameters:
chIx Channel index
sampleIx Sample index
value Data value
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.18 DataSinkList interface


This interface accesses to the DataSink elements of the list. The interface permits to add new sinks, remove
existing sinks and retrieve given DataSink object from the list. With the BioDAQ interface the list of sinks
always contains a Queue type sink.

EREMB-0xxxx-0x Pag. 71 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.18.1 Add
Prototype:
void Add(IDataSink datasink)
Description:
It adds a given sink to the list.
Parameters:
datasink Sink
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Add( struct IDataSink * datasink )
Parameters:
datasink Sink
Function return parameter:
HRESULT COM return code

5.18.2 Clear
Prototype:
void Clear()
Description:
Clean up the list.
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Clear()
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 72 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

HRESULT COM return code

5.18.3 CopyTo
Prototype:
void CopyTo(IDataSink[] array, int arrayIndex)
Description:
Copy a given array of sinks, starting a the specified index of the target array
Parameters:
array Sinks array
arrayIndex Starting index
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT CopyTo(SAFEARRAY * array, long arrayIndex)
Parameters:
array Sinks array
arrayIndex Starting index
Function return parameter:
HRESULT COM return code

5.18.4 Contains
Prototype:
bool Contains(IDataSink datasink)
Description:
It returns True if given sink belongs to the list
Parameters:
datasink Sink
Function return parameter:
True Sink belongs to the list
False Sink does not belong to the list

EREMB-0xxxx-0x Pag. 73 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

See also:

C++ version:
Prototype:
VARIANT_BOOL Contains( struct IDataSink * datasink )
Parameters:
datasink Sink
Function return parameter:
VARIANT_TRUE Sink belong to the list
VARIANT_FALSE Sink does not belong to the list

5.18.5 Count
Prototype:
int Count() {get;}
Description:
It returns the number of sinks in the list.
Parameters:
Function return parameter:
Count Number of elements

C++ version:
Prototype:
long Count
long GetCount()
HRESULT get_Count( long * pVal )
Parameters:
Function return parameter:
pVal Number of elements

5.18.6 GetEnumerator
Prototype:
IDataSinkEnum GetEnumerator()

EREMB-0xxxx-0x Pag. 74 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It returns the IDataSinkEnum interface related to the list of sinks. The IDataSinkEnum interface permits to
access elements of list. The IDataSinkEnum interface derives from IEnumerator interface. See Microsoft
MSDN for a detailed definition on IEnumerator interface
Parameters:
Function return parameter:
GetEnumerator IdataSinkEnum interface

C++ version:
Prototype:
IDataSinkEnumPtr GetEnumerator()
Parameters:
Function return parameter:
pVal IdataSinkEnum interface

5.18.7 IndexOf
Prototype:
int IndexOf(IDataSink datasink)
Description:
It returns the index where the given sink is stored in the list.
Parameters:
datasink Sink
Function return parameter:
IndexOf Index in the list

C++ version:
Prototype:
long IndexOf( struct IDataSink * datasink )
Parameters:
datasink Sink
Function return parameter:
IndexOf Index in the list

EREMB-0xxxx-0x Pag. 75 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.18.8 Insert
Prototype:
void Insert(int index, IDataSink datasink)
Description:
It inserts the sink in the list at given index.
Parameters:
index Index in the list
datasink Sink
Function return parameter:

C++ version:
Prototype:
HRESULT Insert( long index, struct IDataSink * datasink )
Parameters:
index Index in the list
datasink Sink
Function return parameter:
HRESULT COM return code

5.18.9 IsReadOnly
Prototype:
bool IsReadOnly() {get;}
Description:
It returns False. The access to the list is not complete.
Parameters:
Function return parameter:
False The access to the list is limited

C++ version:
Prototype:
VARIANT_BOOL IsReadOnly
VARIANT_BOOL GetIsReadOnly()
HRESULT get_IsReadOnly ( VARIANT_BOOL * pVal )
Parameters:

EREMB-0xxxx-0x Pag. 76 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


VARIANT_FALSE The access to the list is limited

5.18.10 Remove
Prototype:
bool Remove(IDataSink datasink)
Description:
It removes the sink from the list.
Parameters:
datasink Sink to remove
Function return parameter:
True Successful operation
False Failed operation

See also:

C++ version:
Prototype:
VARIANT_BOOL Remove( struct IDataSink * datasink )
Parameters:
datasink Sink to remove
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.18.11 RemoveAt
Prototype:
void RemoveAt(int index)
Description:
It removes the sink from the list at given index
Parameters:
index Index of sink to remove
Function return parameter:

EREMB-0xxxx-0x Pag. 77 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

See also:

C++ version:
Prototype:
HRESULT RemoveAt( long index )
Parameters:
index Index of sink to remove
Function return parameter:
HRESULT COM return code

5.18.12 This[index]
Prototype:
IDataSink This[int index] {get; set;}
Description:
It returns/sets the Sink specified by the given index.
Parameters:
index Index in the list
Function return parameter:
IDataSink Sink interface

C++ version:
Prototype:
IDataSinkPtr Item[]
IDataSinkPtr GetItem( long index )
HRESULT get_Item( long index, struct IDataSink * * pVal )
Parameters:
index Index in the list
Function return parameter:
pVal Sink interface

Prototype:
IDataSinkPtr Item[]
void PutRefItem( long index, struct IDataSink * newVal )

EREMB-0xxxx-0x Pag. 78 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

HRESULT putref_Item ( long index, struct IDataSink * newVal )


Parameters:
index Index in the list
newVal Sink interface
Function return parameter:

5.19 DataSinksEnum interface


Interface to access to list of DataSinks. The list of sinks is handled by the DataSinkList interface. This
interface derives from IEnumerator interface. See Microsoft MSDN for a detailed definition on IEnumerator
interface

5.19.1 Current
Prototype:
IDataSink Current() {get;}
Description:
It returns the current element from the list.
Parameters:
Function return parameter:
Current Current sink from list

C++ version:
Prototype:
IDataSinkPtr Current
IDataSinkPtr GetCurrent()
HRESULT get_Current( struct IDataSink * * pVal )
Parameters:
Function return parameter:
pVal Current sink from list

5.19.2 MoveNext
Prototype:
bool MoveNext()
Description:

EREMB-0xxxx-0x Pag. 79 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

It moves to the next sink in the list.


Parameters:
Function return parameter:
True Successful operation
False Failed operation: current element is the last element
of the list

See also:

C++ version:
Prototype:
VARIANT_BOOL MoveNext()
Parameters:
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation: current element is the last element
of the list

5.19.3 Reset
Prototype:
void Reset()
Description:
It sets the enumerator pointer to initial position (before the first element of the list).
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Reset()
Parameters:
Function return parameter:
HRESULT COM return code

EREMB-0xxxx-0x Pag. 80 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.20 DiskSink interface


Interface to handle the Disk sink. This interface permits to address the acquired data to the disk in a binary
file with custom format. This interface permits to address the “downloaded” data to the disk in a binary file
with custom format. The interface permits to retrieve and to set the Processors used by the sink for each
data channel. Also the interface permits to set the full path binary file name containing the data saved
during acquisition and it permits to set the full path binary file name containing the data saved during
download operation. The interface ITrialReader retrieves the information saved in the binary files.

5.20.1 DownloadFileName
Prototype:
string DownloadFileName {get; set;}
Description:
It retrieves/sets the full path binary file name where data are saved during the download. The data are
encoding with a custom format.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t DownloadFileName
_bstr_t GetDownloadFileName()
HRESULT get_DownloadFileName( BSTR * pVal )
Parameters:
pVal Full path file name
Function return parameter:

Prototype:
_bstr_t DownloadFileName
void PutDownloadFileName( _bstr_t newVal )
HRESULT putref_DownloadFileName( BSTR newVal )
Parametri:
newVal Full path file name
Function return parameter:

EREMB-0xxxx-0x Pag. 81 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.20.2 DownloadStart
Prototype:
SinkExitStatus DownloadStart( Protocol protocol )
Description:
Arm the sink in order to receive data during download.
Parameters:
protocol Protocol (channels collection) to acquire
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:
DownloadStop

C++ version:
Prototype:
SinkExitStatus DownloadStart( struct IProtocol * protocol )
HRESULT DownloadStart( [in] struct IProtocol * protocol, [out, retval]
SinkExitStatus * pVal )
Parameters:
protocol Protocol (channels collection) to acquire
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.20.3 DownloadStop
Prototype:
SinkExitStatus DownloadStop()
Description:
Release the resources used during the download operation.
Parameters:
Function return parameter:
SinkExitStatus.Success Success

EREMB-0xxxx-0x Pag. 82 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

SinkExitStatus.InvalidOperation Invalid operation


SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:
DownloadStart

C++ version:
Prototype:
SinkExitStatus DownloadStop()
HRESULT DownloadStop( [out, retval] SinkExitStatus * pVal )
Parameters:
Function return paramater:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.20.4 DownloadWrite
Prototype:
SinkExitStatus DownloadWrite( int chIx, long sampleIx, float value )
Description:
It writes the data value in the sink for the given channel during download operation.
You have not to use this method directly, if you add the sink to the list of datasinks of the controller.
Parameters:
chIx Channel index
sampleIx Sample index
value Sample value
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

EREMB-0xxxx-0x Pag. 83 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
SinkExitStatus DownloadWrite( long chIx, __int64 sampleIx, float value )
HRESULT DownloadWrite( [in] long chIx, [in] __int64 sampleIx, [in] float
value, [out, retval] SinkExitStatus * pVal )
Parameters:
chIx Channel index
sampleIx Sample index
value Sample value
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.20.5 FileName
Prototype:
string FileName {get; set;}
Description:
It retrieves/sets the full path binary file name where data are saved. The data are encoding with a custom
format.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t FileName
_bstr_t GetFileName()
HRESULT get_FileName( BSTR * pVal )
Parameters:
pVal Full path file name
Function return parameter:

Prototype:
_bstr_t FileName

EREMB-0xxxx-0x Pag. 84 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

void PutFileName( _bstr_t newVal )


HRESULT putref_FileName( BSTR newVal )
Parameters:
newVal Full path file name
Function return parameter:

5.20.6 GetProcessor
Prototype:
IProcessor GetProcessor( int chIx )
Description:
It retrieves the math processor for a given channel index. There are many processors as the number of
channels.
Parameters:
chIx Channel index
Function return parameter:
IProcessor IProcessor interface

See also:

C++ version:
Prototype:
IProcessorPtr GetProcessor( long chIx )
Parameters:
chIx Channel index
Function return parameter:
pVal IProcessor interface

5.20.7 SetProcessor
Prototype:
SinkExitStatus SetProcessor( IProcessor processor, int chIx )
Description:
It sets the math processor for a given channel index. For each channel it is possible to set a processor.
Parameters:
processor Processor

EREMB-0xxxx-0x Pag. 85 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

chIx Channel index


Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus SetProcessor( struct IProcessor * processor, long chIx )
Parameters:
processor Processor
chIx Channel index
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.21 EMA Processor Interface


This interface implements an EMA (Exponential Moving Average) filter for the acquired EMG data.
For further details, see the page:
http://en.wikipedia.org/wiki/Exponential_moving_average#Exponential_moving_average.

5.21.1 NTimePeriods
Prototype:
int NTimePeriods {get;}
Description:
It retrieves the number of periods used to create the EMA filter.
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 86 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
long NTimePeriods
long GetNTimePeriods()
HRESULT get_NTimePeriods( long * pVal )
Parameters:
pVal Time periods
Function return parameter:

5.22 Exporter interface


The interface permits the conversion of acquired data in a TDF file format. The TDF file format is a
proprietary file format of BTS. The Exporter interface requires the full path file name of TDF file and the
ITrialReader interface for retrieve data saved in the binary file. The binary file has been created by the Disk
sink during the arm operation and it has been filled during data acquisition process.

FOOTSWITCH DATA CONVERSION RULES

The footswitch data are converted according to a specific rule. In the acquisition protocol with FSW
channels, the contact areas are specified as follows: every single area is identified by a label.
As you can see in the figure below the contact areas are grouped in clearly defined districts.

EREMB-0xxxx-0x Pag. 87 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Figure 2: Contact areas for left and right footswitch signals

The following table specifies the values in volts that are associated to the contact area when this is active
(on status):
Etichetta segnali/area contatto Valore
FS1, FS5, IC_Left, IC_Right 0.4 mV
FS2, FS6, EC_Left, EC_Right 0.8 mV
FS3, FS7, HC_Left, HC_Right 1.6 mV
FS4, FS8, TC_Left, TC_Right 3.2 mV
If the contact area is not active (off state) the associated volt value is zero.
The footswitch signals are obtained as a sum of the contact areas belonging to the specific district and have
a clearly defined label, as shown in the following table:
Segnale footswitch/etichetta Aree di contatto
Left FSW Left FSW = EC_Left + IC_Left +
HC_Left + TC_Left
Right FSW Right FSW = EC_Right + IC_Right +
HC_Right + TC_Right
FSW A FSW A = FS1 + FS2 + FS3 + FS4
FSW B FSW B = FS5 + FS6 + FS7 + FS8
The Left FSW and Right FSW signals refer to the footswitch signals obtainable by positioning the sensors in
the sole of the left and right foot, as shown in the figure; while the FSW A and FSW B signals refer to
general signals, obtained as a sum of the contact areas.

EREMB-0xxxx-0x Pag. 88 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.22.1 ExportData
Prototype:
bool ExportData()
Description:
It converts the acquired data and it saves the data in a file with BTS format (TDF file format). It uses the
ITrialReader interface to retrieve information from binary file related to the Disk sink.
Parameters:
Function return parameter:
True Successful operation
False Failed operation

See also:

C++ version:
Prototype:
VARIANT_BOOL ExportData()
Parameters:
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.22.2 ExportedFile
Prototype:
string ExportedFile {get; set;}
Description:
It retrieves/sets the TDF full path file name where data are saved. The TDF format is a BTS proprietary
format.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t ExportedFile
_bstr_t GetExportedFile()

EREMB-0xxxx-0x Pag. 89 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

HRESULT get_ExportedFile( BSTR * pVal )


Parameters:
pVal TDF full path file name
Function return parameter:

Prototype:
_bstr_t ExportedFile
void PutExportedFile( BSTR newVal )
HRESULT putref_ExportedFile( BSTR newVal )
Parameters:
newVal TDF full path file name
Function return parameter:

5.22.3 TrialReader
Prototype:
ITrialReader TrialReader {get; set;}
Description:
It retrieves/sets the ITrialReader interface. The ITrialReader interface must be specified in order to retrieve
information from binary file.
Parameters:
Function return parameter:

C++ version:
Prototype:
ITrialReaderPtr TrialReader
ITrialReaderPtr GetTrialReader()
HRESULT get_TrialReader( struct ITrialReader * * pVal )
Parameters:
pVal ITrialReader interface
Function return parameter:

Prototype:
ITrialReaderPtr TrialReader
void PutTrialReader( ITrialReaderPtr newVal )
HRESULT putref_TrialReader( struct ITrialReader * newVal )

EREMB-0xxxx-0x Pag. 90 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
newVal ITrialReader interface
Function return parameter:

5.23 MathSink interface


Interface to handle the Math sink. This interface permits to address the acquired data in a Queue type
objects after a real‐time processing with a given Processor. The interface permits to retrieve and to set the
Processors used by the sink for each data channel.

5.23.1 GetProcessor
Prototype:
IProcessor GetProcessor( int chIx )
Description:
It retrieves the math processor for a given channel index. There are many processors as the number of
channels.
Parameters:
chIx Channel index
Function return parameter:
IProcessor IProcessor interface

See also:

C++ version:
Prototype:
IProcessorPtr GetProcessor( long chIx )
Parameters:
chIx Channel index
Function return parameter:
pVal IProcessor interface

5.23.2 SetProcessor
Prototype:
SinkExitStatus SetProcessor( IProcessor processor, int chIx )
Description:

EREMB-0xxxx-0x Pag. 91 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

It sets the math processor for a given channel index. For each channel it is possible to set a processor.
Parameters:
processor Processor
chIx Channel index
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument Invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus SetProcessor( struct IProcessor * processor, long chIx )
Parameters:
processor Processor
chIx Channel index
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.24 PanConfig interface


The interface permits to configure the PAN wireless network related to the BM. The configuration
parameters are the following:
• RF channel;
• PAN identifier (PANId).
The interface sets the properties of the wireless network. With the given information, the BM is forced to
create a wireless network with these parameters. There is a link between the BM and the created PAN: the
serial parameter of PanConfig object contains the serial number of BM. For each BM can exist only one
PAN.

EREMB-0xxxx-0x Pag. 92 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.24.1 PANId
Prototype:
unit PANId {get; set;}
Description:
It retrieves/sets the PAN identifier. For the actual version of system, the PANId has the value 0xA0A0. No
other values are used.
Parameters:
Function return parameter:

C++ version:
Prototype:
unsigned long PANId
unsigned long GetPANId()
HRESULT get_PANId( unsigned long * pVal )
Parameters:
pVal Wireless network identifier
Function return parameter:

Prototype:
unsigned long PANId
void PutPANId( unsigned long newVal )
HRESULT putref_PANId( unsigned long newVal )
Parameters:
newVal Wireless network identifier
Function return parameter:

5.24.2 RFCh
Prototype:
byte RFCh {get; set;}
Description:
It retrieves/sets the RF channel of the wireless network.
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 93 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
unsigned char RFCh
unsigned char GetRFCh()
HRESULT get_RFCh( unsigned char * pVal )
Parameters:
pVal RF channel
Function return parameter:

Prototype:
unsigned char RFCh
void PutRFCh( unsigned char newVal )
HRESULT putref_RFCh( unsigned char newVal )
Parameters:
newVal RF channel
Function return parameter:

5.24.3 Serial
Prototype:
Byte[] Serial {get; set;}
Description:
It retrieves/sets the serial identifier of the wireless network related to the BM. The serial is a 6 element
byte array. The serial permits to associate in a unique manner the PanConfig object to the BM.
Parameters:
Function return parameter:

C++ version:
Prototype:
SAFEARRAY * Serial
SAFEARRAY * GetSerial()
HRESULT get_Serial( SAFEARRAY * * pVal )
Parameters:
pVal Serial identifier
Function return parameter:

EREMB-0xxxx-0x Pag. 94 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Prototype:
SAFEARRAY * Serial
void PutSerial(SAFEARRAY * newVal )
HRESULT putref_Serial( SAFEARRAY * newVal )
Parameters:
newVal Serial identifier
Function return parameter:

5.25 PanConfigList interface


This interface accesses to the PanConfig elements of the list. The interface permits to add new PanConfig
elements, remove existing PanConfig elements and retrieve given PanConfig object from the list. For the
BioDAQ interface, the list of PanConfig objects contains only one element..

5.25.1 Add
Prototype:
void Add(PanConfig item)
Description:
It adds a PanConfig object to the list.
Parameters:
item PanConfig object to add
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Add( struct IPanConfig * item )
Parameters:
item PanConfig object to add
Function return parameter:
HRESULT COM return code

EREMB-0xxxx-0x Pag. 95 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.25.2 Clear
Prototype:
void Clear()
Description:
It deletes all elements from the list.
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Clear()
Parameters:
Function return parameter:
HRESULT COM return code

5.25.3 Count
Prototype:
int Count()
Description:
It retrieves the number of elements in the list.
Parameters:
Function return parameter:
Count Number of elements

C++ version:
Prototype:
long Count()
Parameters:
Function return parameter:
Count Number of elements

EREMB-0xxxx-0x Pag. 96 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.25.4 IndexOf
Prototype:
int IndexOf(PanConfig item)
Description:
It returns the index where the given PanConfig is stored in the list.
Parameters:
item PanConfig
Function return parameter:
IndexOf Index in the list

C++ version:
Prototype:
long IndexOf( struct IPanConfig * item )
Parameters:
item PanConfig
Function return parameter:
IndexOf Index in the list

5.25.5 Insert
Prototype:
void Insert(int index, PanConfig item)
Description:
It inserts the PanConfig object in the list at given index.
Parameters:
index Index in the list
item PanConfig object
Function return parameter:

C++ version:
Prototype:
HRESULT Insert( long index, struct IPanConfig * item )
Parameters:
index Index in the list
item PanConfig object
Function return parameter:

EREMB-0xxxx-0x Pag. 97 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

HRESULT COM return code

5.25.6 Remove
Prototype:
bool Remove(PanConfig item)
Description:
It removes the PanConfig object from the list.
Parameters:
item PanConfig to remove
Function return parameter:
True Successful operation
False Failed operation

See also:

C++ version:
Prototype:
VARIANT_BOOL Remove( struct IPanConfig * item )
Parameters:
item PanConfig to remove
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.26 Port interface


The interface is a base interface for the connected ports of BM. The PortCOM interface uses the base
interface to set the hardware properties of the port.

5.26.1 Serial port Baud rate codes


The table contains the serial port baud rate codes:
Coding types Value Description
baud2400 2400 Baud rate: 2400 bits per second.
baud4800 4800 Baud rate: 4800 bits per second.

EREMB-0xxxx-0x Pag. 98 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

baud9600 9600 Baud rate: 9600 bits per second.


baud19200 19200 Baud rate: 19200 bits per second.
baud38400 38400 Baud rate: 38400 bits per second.
baud57600 57600 Baud rate: 57600 bits per second.
baud115200 115200 Baud rate: 115220 bits per second.
baud230400 230400 Baud rate: 230400 bits per second.
NOT supported for all PC types.

5.26.1 Type
Prototype:
Drivers.PortType Type {get;}
Description:
It retrieves the type of port.
Parameters:
Function return parameter:
Type Type of port

C++ version:
Prototype:
bts_biodaq_drivers::PortType Type
bts_biodaq_drivers::PortType GetType()
HRESULT get_Type( bts_biodaq_drivers::PortType * pVal )
Parameters:
Function return parameter:
pVal Type of port

5.27 PortCOM interface


The interface permits to set the properties of a serial COM port. The properties refer to protocol
transmission through the serial port (baud rate, data bits, ...) and handshake protocol (data transmission
handled by the OS).

5.27.1 Baudrate
Prototype:
BaudRate BaudRate {get; set;}

EREMB-0xxxx-0x Pag. 99 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It retrieves/sets the baud rate for the serial COM port. The value must be set to 230400 bits per second.
Parameters:
Function return parameter:

C++ version:
Prototype:
BaudRate BaudRate
BaudRate GetBaudRate ()
HRESULT get_BaudRate( BaudRate * pVal )
Parameters:
pVal Baud rate
Function return parameter:

Prototype:
BaudRate BaudRate
void PutBaudRate( BaudRate newVal )
HRESULT putref_BaudRate( BaudRate newVal )
Parameters:
newVal Baud rate
Function return parameter:

5.27.2 DataBits
Prototype:
int DataBits {get; set;}
Description:
It retrieves/sets the number of bits representing a data value in the data transmission protocol for the
serial COM port. Default value: 8 bits.
Parameters:
Function return parameter:

C++ version:
Prototype:
long DataBits

EREMB-0xxxx-0x Pag. 100 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

long GetDataBits ()
HRESULT get_DataBits( long * pVal )
Parameters:
pVal Number of bits
Function return parameter:

Prototype:
long DataBits
void PutDataBits( long newVal )
HRESULT putref_DataBits( long newVal )
Parameters:
newVal Number of bits
Function return parameter:

5.27.3 Description
Prototype:
String Description {get;}
Description:
It retrieves the description (a label value) of the serial COM port.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t Description
_bstr_t GetDescription ()
HRESULT get_Description( BSTR * pVal )
Parameters:
Function return parameter:
pVal Description

5.27.4 Handshake
Prototype:
int Handshake {get; set;}

EREMB-0xxxx-0x Pag. 101 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It retrieves/sets the handshake protocol (control transmission protocol) of the serial port COM. Default
value: RTS (Request To Send) handshake protocol. See Microsoft MSDN for a detailed definition of
System.IO.Ports objects.
Parameters:
Function return parameter:

C++ version:
Prototype:
long Handshake
long GetHandshake ()
HRESULT get_Handshake( long * pVal )
Parameters:
pVal Handshake protocol code
Function return parameter:

Prototype:
long Handshake
void PutHandshake( long newVal )
HRESULT putref_Handshake( long newVal )
Parameters:
newVal Handshake protocol code
Function return parameter:

5.27.5 Number
Prototype:
byte Number {get; set;}
Description:
It retrieves/sets the port number as defined by the operative system (OS).
Parameters:
Function return parameter:

C++ version:
Prototype:
unsigned char Number

EREMB-0xxxx-0x Pag. 102 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

unsigned char GetNumber()


HRESULT get_Number( unsigned char * pVal )
Parameters:
pVal Port number
Function return parameter:

Prototype:
unsigned char Number
void PutNumber( unsigned char newVal )
HRESULT putref_Number( unsigned char newVal )
Parameters:
newVal Port number
Function return parameter:

5.27.6 ParityBit
Prototype:
int ParityBit {get; set;}
Description:
It retrieves/sets the parity bits check control in the protocol transimission of serial port COM. Default value:
none parity bit check control. See Microsoft MSDN for a detailed definition of System.IO.Ports objects.
Parameters:
Function return parameter:

C++ version:
Prototype:
long ParityBit
long GetParityBit()
HRESULT get_ParityBit( [out, retval] long * pVal )
Parameters:
pVal Parity bits check control code
Function return parameter:

Prototype:

EREMB-0xxxx-0x Pag. 103 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

long ParityBit
void PutParityBit( long newVal )
HRESULT putref_ParityBit(long newVal )
Parameters:
newVal Parity bits check control code
Function return parameter:

5.27.7 Portname
Prototype:
String PortName {get;}
Description:
It retrieves the name of the serial port COM as defined by the operative system (OS).
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t PortName
_bstr_t GetPortName()
HRESULT get_PortName( BSTR * pVal )
Parameters:
Function return parameter:
pVal Name of port

5.28 PortList interface


This interface handles a list of ports. For the actual version of system, the BioDAQ interface use a PortList
object containing only one port related to a connected BM. The interface permits to add new port to the
list, to remove existing ports from the list and retrieve a given port from the list.

5.28.1 Add
Prototype:
void Add(Port port)
Description:
It adds a port to the list.

EREMB-0xxxx-0x Pag. 104 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
port Port
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Add( struct IPort * port )
Parameters:
port Port
Function return parameter:
HRESULT COM return code

5.28.2 Clear
Prototype:
void Clear()
Description:
It deletes the list of ports.
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Clear()
Parameters:
Function return parameter:
HRESULT COM return code

EREMB-0xxxx-0x Pag. 105 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.28.3 Contains
Prototype:
bool Contains(Port port)
Description:
It returns True if given port belongs to the list.
Parameters:
port Port
Function return parameter:
True The port belongs to the list
False The port does not belong to the list

See also:

C++ version:
Prototype:
HRESULT Contains(struct IPort * port)
Parameters:
port Port
Function return parameter:
VARIANT_TRUE The port belongs to the list
VARIANT_FALSE The port does not belong to the list

5.28.4 Count
Prototype:
int Count() {get;}
Description:
It retrieves the number of ports in the list.
Parameters:
Function return parameter:
Count Number of elements

C++ version:
Prototype:
long Count

EREMB-0xxxx-0x Pag. 106 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

long GetCount()
HRESULT get_Count( long * pVal )
Parameters:
Function return parameter:
pVal Number of elements

5.28.5 CopyTo
Prototype:
void CopyTo(Port[] array, int arrayIndex)
Description:
Copy a given array of ports, starting at the specified index of the target array.
Parameters:
array Ports array
arrayIndex Starting index
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT CopyTo(SAFEARRAY * array, long arrayIndex)
Parameters:
array Ports array
arrayIndex Starting index
Function return parameter:
HRESULT COM return code

5.28.6 GetEnumerator
Prototype:
IPortsEnum GetEnumerator()
Description:
It returns the IPortsEnum interface related to the list of ports. The IPortsEnum interface permits to access
elements of list. The IPortsEnum interface derives from IEnumerator interface. See Microsoft MSDN for a
detailed definition on IEnumerator interface

EREMB-0xxxx-0x Pag. 107 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
GetEnumerator IPortsEnum interface

C++ version:
Prototype:
IPortsEnumPtr GetEnumerator()
Parameters:
Function return parameter:
pVal IPortsEnum interface

5.28.7 IndexOf
Prototype:
int IndexOf(Port port)
Description:
It returns the index where the given port is stored in the list.
Parameters:
port Port
Function return parameter:
IndexOf Index in the list

C++ version:
Prototype:
long IndexOf( struct IPort * port )
Parameters:
port Port
Function return parameter:
IndexOf Index in the list

5.28.8 Insert
Prototype:
void Insert(int index, Port port)

EREMB-0xxxx-0x Pag. 108 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It inserts the port in the list at given index.
Parameters:
index Index in the list
port Port
Function return parameter:

C++ version:
Prototype:
HRESULT Insert( long index, struct IPort * port )
Parameters:
index Index in the list
port Port
Function return parameter:
HRESULT COM return code

5.28.9 IsReadOnly
Prototype:
bool IsReadOnly() {get;}
Description:
It returns False. The access to the list is not complete.
Parameters:
Function return parameter:
False The access to the list is limited

C++ version:
Prototype:
VARIANT_BOOL IsReadOnly
VARIANT_BOOL GetIsReadOnly()
HRESULT get_IsReadOnly( VARIANT_BOOL * pVal )
Parameters:
Function return parameter:
VARIANT_FALSE The access to the list is limited

EREMB-0xxxx-0x Pag. 109 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.28.10 Remove
Prototype:
bool Remove(Port port)
Description:
It removes the port from the list.
Parameters:
port Port to remove
Function return parameter:
True Successful operation
False Failed operation

See also:

C++ version:
Prototype:
VARIANT_BOOL Remove( struct IPort * port )
Parameters:
port Port to remove
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.28.11 RemoveAt
Prototype:
void RemoveAt(int index)
Description:
It removes theport from the list at given index
Parameters:
index Index of port to remove
Function return parameter:

See also:

EREMB-0xxxx-0x Pag. 110 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
HRESULT RemoveAt( long index )
Parameters:
index Index of port to remove
Function return parameter:
HRESULT COM return code

5.28.12 This[index]
Prototype:
Port This[int index] {get; set;}
Description:
It returns/sets the Port specified by the given index.
Parameters:
index Index in the list
Function return parameter:
Port Port

C++ version:
Prototype:
IPortPtr Item[]
IPortPtr GetItem( long index )
HRESULT get_Item( long index, struct IPort * * pVal )
Parameters:
index Index in the list
pVal Port
Function return parameter:

Prototype:
IPortPtr Item[]
void PutItem( long index, struct IPort * newVal )
HRESULT putref_Item( long index, struct IPort * newVal )
Parameters:
index Index in the list

EREMB-0xxxx-0x Pag. 111 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

newVal Port
Function return parameter:

5.29 PortsEnum interface


Interface to access to list of Ports. The list of ports is handled by the PortList interface. This interface derives
from IEnumerator interface. See Microsoft MSDN for a detailed definition on IEnumerator interface

5.29.1 Current
Prototype:
Port Current() {get;}
Description:
It returns the current element from the list.
Parameters:
Function return parameter:
Current Current port from list

C++ version:
Prototype:
IPortPtr Current
IPortPtr GetCurrent()
HRESULT get_Count(struct IPort * * pVal )
Parameters:
Function return parameter:
pVal Current port from list

5.29.2 MoveNext
Prototype:
bool MoveNext()
Description:
It moves to the next port in the list.
Parameters:
Function return parameter:
True Successful operation

EREMB-0xxxx-0x Pag. 112 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

False Failed operation: current element is the last element


of the list

See also:

C++ version:
Prototype:
VARIANT_BOOL MoveNext()
Parameters:
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation: current element is the last element
of the list

5.29.3 Reset
Prototype:
void Reset()
Description:
It sets the enumerator pointer to initial position (before the first element of the list).
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Reset()
Parameters:
Function return parameter:
HRESULT COM return code

EREMB-0xxxx-0x Pag. 113 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.30 PortsManager interface


The interface retrieves the list of serial COM ports recognized by the operative system (OS). The interface
gets the list of port names by the System.IO.Ports.SerialPort class (.NET framework).

5.30.1 GetAvailableSerialPorts
Prototype:
PortList GetAvailableSerialPorts()
Description:
It retrieves the list of serial COM ports available in the system.
Parameters:
Function return parameter:
GetAvailableSerialPorts Serial COM port list

See also:

C++ version:
Prototype:
IPortListPtr GetAvailableSerialPorts()
Parameters:
Function return parameter:
pVal Serial COM ports

5.31 Processor interface


This interface defines the real‐time data processing. The interface is used in connection with the MathSink
object. The SDK implements three type of processors:
• Transparent: data are NOT processed but they are stored as they are received;
• RMS: data are processed to get the RMS (root mean square ) and save in the “Queue” type objects.
For the actual version of system, RMS processor is not completely implemented;
• EMA: data are filtered by the EMA (Exponential Moving Average) filter and save in the “Queue”
type objects.

5.31.1 Processor types codes


La tabella contiene l’elenco dei tipi di tipi di processor riconosciuti:
The table contains the processor type codes:
Type Description

EREMB-0xxxx-0x Pag. 114 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Transparent NO data processing.


RMS Carry‐out the RMS (root mean square).
EMA Apply EMA (Exponential Moving Average) filter
The RMS processor is not supported completely.

5.31.2 CalculateValue
Prototype:
float CalculateValue( long sampleIx, float value )
Description:
It applied the processing to the sample value for the given index.
Parameters:
sampleIx Sample index
value Sample value
Function return parameter:
pVal Processed sample value.

See also:

C++ version:
Prototype:
float CalculateValue( __int64 sampleIx, float value )
Parameters:
sampleIx Sample index
value Sample value
Function return parameter:
pVal Processed sample value.

5.31.1 Type
Prototype:
ProcessorType Type {get;}
Description:
It retrieves the type of processor.
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 115 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Type Type of processor

C++ version:
Prototype:
ProcessorType Type
ProcessorType GetType()
HRESULT get_Type( ProcessorType * pVal )
Parameters:
Function return parameter:
pVal Type of processor

5.31.2 Write
Prototype:
bool Write( long sampleIx, float value, Queue<DataSample> queue )
Description:
It writes the sample value for the given index in the “queue” object after real‐time processing provided by
the processor.
Parameters:
sampleIx Sample index
value Sample value
queue Queue object where data is saved
Function return parameter:
True Successful operation
False Failed operation

See also:

C++ version:
Prototype:
VARIANT_BOOL Write( __int64 sampleIx, float value, ? queue )
Parameters:
sampleIx Sample index
value Sample value
queue Queue object where data is saved

EREMB-0xxxx-0x Pag. 116 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.32 Protocol interface


The interface manages a collection of ProtocolItems objects. The protocol defines a list of channels which
are acquired. The list of channels in the protocol must be compatible with the sensors profile currently in
use.
In order to acquire data from FSW channels, the names of contact areas are chosen from:

Signal labels/contact areas


FS1, FS5, IC_Left, IC_Right
FS2, FS6, EC_Left, EC_Right
FS3, FS7, HC_Left, HC_Right
FS4, FS8, TC_Left, TC_Right

NOTE:
In the protocol the EMG channels must be set before the EGN channels and/or FSW channels.
If you use a protocol with FSW channels, it is necessary that channel with SensorChannelIndex = 0 has the
following properties: it is an enabled channel and it belongs to the protocol.

5.32.1 Add
Prototype:
void Add(ProtocolItem protocolItem)
Description:
It adds a new protocol item to the list.
Parameters:
protocolItem Protocol item to add
Function return parameter:

See also:

C++ version:
Prototype:

EREMB-0xxxx-0x Pag. 117 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

HRESULT Add( struct IProtocolItem * protocolItem )


Parameters:
protocolItem Protocol item to add
Function return parameter:
HRESULT COM return code

5.32.2 Count
Prototype:
int Count()
Description:
It retrieves the number of protocol items in the list.
Parameters:
Function return parameter:
Count Number of elements

C++ version:
Prototype:
long Count()
Parameters:
Function return parameter:
pVal Number of elements

5.32.3 Clear
Prototype:
void Clear()
Description:
It deletes all items form the list.
Parameters:
Function return parameter:

See also:

EREMB-0xxxx-0x Pag. 118 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
HRESULT Clear()
Parameters:
Function return parameter:
HRESULT COM return code

5.32.4 IndexOf
Prototype:
int IndexOf ( ProtocolItem protocolItem )
Description:
It returns the index where the given protocol item is stored in the list.
Parameters:
protocolItem Protocol item
Function return parameter:
IndexOf Index in the list

C++ version:
Prototype:
long IndexOf( struct IProtocolItem * protocolItem )
Parameters:
ProtocolItem Protocol item
Function return parameter:
IndexOf Index in the list

5.32.5 Insert
Prototype:
bool Insert(int index, ProtocolItem protocolItem)
Description:
It inserts the port in the list at given index.
Parameters:
index Index in the list
protocolItem Protocol item

EREMB-0xxxx-0x Pag. 119 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Function return parameter:


True Successful operation
False Failed operation

C++ version:
Prototype:
VARIANT_BOOL Insert( long index, struct IProtocolItem * protocolItem )
Parameters:
index Index in the list
protocolItem Protocol item
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.32.6 Item
Prototype:
ProtocolItem Item ( int index )
Description:
It retrieves the protocol item object for a given index from the list.
Parameters:
index Index in the list
Function return parameter:
Item Protocol item

C++ version:
Prototype:
IProtocolItemPtr Item( long index )
Parameters:
index Index in the list
Function return parameter:
Item Protocol item

EREMB-0xxxx-0x Pag. 120 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.32.7 Load
Prototype:
bool Load ( String protocolFileName )
Description:
It loads the protocol from the specified file. Method NOT implemented.
Parameters:
protocolFileName Full path file name
Function return parameter:
True Successful operation
False Failed operation

C++ version:
Prototype:
VARIANT_BOOL Load( _bstr_t protocolFileName )
Parameters:
protocolFileName Full path file name
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.32.8 Remove
Prototype:
bool Remove(ProtocolItem protocolItem)
Description:
It removes the given protocol item from the list.
Parameters:
protocolItem Protocol item to remove
Function return parameter:
True Successful operation
False Failed operation

See also:

C++ version:

EREMB-0xxxx-0x Pag. 121 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Prototype:
VARIANT_BOOL Remove( struct IProtocolItem * protocolItem )
Parameters:
protocolItem Protocol item to remove
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.32.9 Save
Prototype:
bool Save ( String protocolFileName )
Description:
It saves the protocol in a specified file. Method NOT implemented.
Parameters:
protocolFileName Full path file name
Function return parameter:
True Successful operation
False Failed operation

C++ version:
Prototype:
VARIANT_BOOL Save( _bstr_t protocolFileName )
Parameters:
protocolFileName Full path file name
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation

5.33 ProtocolItem interface


The interface handles the protocol item. The protocol is a collection of protocol items. The protocol item
refers the channel enabled for the data acquisition. With the use of interface it can be possible to retrieve
the channel related to the protocol item and the sensor related to the channel. The SensorChannelIndex
property specifies the index of channel inside the related sensor.
For EMG sensor there is only one channel for each sensor (SensorChannelIndex = 0).
For AUX sensor there are 6 channels: 2 channels for the EGN mode (SensorChannelIndex = 4, 5) and 4
channels for FSW mode (SensorChannelIndex =0, 1, 2, 3).

EREMB-0xxxx-0x Pag. 122 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

For the AUXEGN sensor there are 2 channels (SensorChannelIndex = 4, 5).


For the AUXEGN sensor there are 4 channels (SensorChannelIndex = 0, 1, 2 ,3).

5.33.1 Protocol item state codes


The table contains the protocol item state codes:
Error types Value Description
Missing 0 Protocol item is not available for the current channels
configuration.
Available 1 Protocol item is available for the current channels configuration.
Error 2 Protocol item generates an error for the current channels
configuration.
Undefined 3 Protocol item NOT defined.
This state is NOT used.

5.33.2 Channel
Prototype:
Channel Channel {get;}
Description:
It retrieves the channel related to the protocol item.
Parameters:
Function return parameter:
Channel Channel

C++ version:
Prototype:
IChannelPtr Channel
IChannelPtr GetChannel()
HRESULT get_Channel( struct IChannel * * pVal )
Parameters:
Function return parameter:
pVal Channel

5.33.3 ChannelName
Prototype:

EREMB-0xxxx-0x Pag. 123 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

String ChannelName {get; set;}


Description:
It retrieves/sets the name of channel.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t ChannelName
_bstr_t GetChannelName()
HRESULT get_ChannelName( BSTR * pVal )
Parameters:
pVal Name of channel
Function return parameter:

Prototype:
_bstr_t ChannelName
void PutChannelName( _bstr_t newVal )
HRESULT putref_ChannelName( BSTR newVal )
Parameters:
newVal Name of channel
Function return parameter:

5.33.4 ChannelType
Prototype:
ChannelType ChannelType {get; set;}
Description:
It retrieves/sets the channel type (EMG; EGN or FSW).
Parameters:
Function return parameter:

C++ version:
Prototype:

EREMB-0xxxx-0x Pag. 124 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

ChannelType ChannelType
ChannelType GetChannelType()
HRESULT get_ChannelType( ChannelType * pVal )
Parameters:
pVal Type of channel
Function return parameter:

Prototype:
ChannelType ChannelType
void PutChannelType( ChannelType newVal )
HRESULT putref_ChannelType( ChannelType newVal )
Parameters:
newVal Type of channel
Function return parameter:

5.33.5 SensorChannelIndex
Prototype:
int SensorChannelIndex {get; set;}
Description:
It retrieves/sets the index of channel inside the related sensor.
Parameters:
Function return parameter:

C++ version:
Prototype:
long SensorChannelIndex
long GetSensorChannelIndex()
HRESULT get_SensorChannelIndex( long * pVal )
Parameters:
pVal Index of channel inside the related sensor
Function return parameter:

Prototype:

EREMB-0xxxx-0x Pag. 125 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

long SensorChannelIndex
void PutSensorChannelIndex( long newVal )
HRESULT putref_SensorChannelIndex( long newVal )
Parameters:
newVal Index of channel inside the related sensor
Function return parameter:

5.33.6 SensorColor
Prototype:
System.Drawing.Color SensorColor {get; set;}
Description:
It retrieves/sets the sensor color. The sensor is related to the protocol item.
Parameters:
Function return parameter:

C++ version:
Prototype:
OLE_COLOR SensorColor
OLE_COLOR GetSensorColor()
HRESULT get_SensorColor( OLE_COLOR * pVal )
Parameters:
pVal Sensor color
Function return parameter:

Prototype:
OLE_COLOR SensorColor
void PutSensorColor( OLE_COLOR newVal )
HRESULT putref_SensorColor( OLE_COLOR newVal )
Parameters:
newVal Sensor color
Function return parameter:

EREMB-0xxxx-0x Pag. 126 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.33.7 SensorLabel
Prototype:
String SensorLabel {get; set;}
Description:
It retrieves/sets the sensor label. The sensor is related to the protocol item.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t SensorLabel
_bstr_t GetSensorLabel()
HRESULT get_SensorLabel( BSTR * pVal )
Parameters:
pVal Sensor label
Function return parameter:

Prototype:
_bstr_t SensorLabel
void PutSensorLabel( _bstr_t newVal )
HRESULT putref_SensorLabel( BSTR newVal )
Parameters:
newVal Sensor label
Function return parameter:

5.33.8 SensorReference
Prototype:
SensorView SensorReference {get;}
Description:
It retrieves the sensor related to the protocol item.
Parameters:
Function return parameter:
Sensor Sensor

EREMB-0xxxx-0x Pag. 127 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
ISensorViewPtr SensorReference
ISensorViewPtr GetSensorReference()
HRESULT get_SensorReference( struct ISensorView * * pVal )
Parameters:
Function return parameter:
pVal Sensor

5.33.9 State
Prototype:
ProtocolItemState State {get;}
Description:
It retrieves the state of protocol item.
Parameters:
Function return parameter:
State State

C++ version:
Prototype:
ProtocolItemState State
ProtocolItemState GetState()
HRESULT get_State( ProtocolItemState * pVal )
Parameters:
Function return parameter:
pVal State

5.34 QueueSink interface


The interface handles the sink of type “queue”. The acquired data are stored in a “Queue” type objects in
order to retrieve them, when necessary.
The used data structures derived from System.Collection.Generic.Dictionary<key, value> structure. These
structures are provided by the .NET Framework. For the BioDAQ interface the list of sink always contains a
“Queue” type sink.

EREMB-0xxxx-0x Pag. 128 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.34.1 Dequeue
Prototype:
SinkExitStatus Dequeue( int chIx, out long sampleIx, out float value )
Description:
It retrieves the first data sample (value, sample index) available from the “Queue” data structure for the
given channel. The data sample is then removed from the “Queue” data structure.
Parameters:
chIx Channel index
sampleIx Sample index
value Sample value
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:
SinkExitStatus Dequeue( long chIx, __int64 * sampleIx, float * value )
Parameters:
chIx Channel index
sampleIx Sample index
value Sample value
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.34.2 QueueSize
Prototype:
int QueueSize ( int chIx )

EREMB-0xxxx-0x Pag. 129 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It retrieves the size of the “Queue” data structure for the given channel.
Parameters:
chIx Channel index
Function return parameter:
QueueSize Size (number of samples)

C++ version:
Prototype:
long QueueSize( long chIx )
Parameters:
chIx Channel index
Function return parameter:
pVal Size (number of samples)

5.34.3 Read
Prototype:
SinkExitStatus Read( int chIx, long sampleIx, out float value )
Description:
It retrieves the sample value of given sample index for the given channel.
Parameters:
chIx Channel index
sampleIx Sample index
value Sample value
Function return parameter:
SinkExitStatus.Success Success
SinkExitStatus.InvalidOperation Invalid operation
SinkExitStatus.InvalidArgument invalid argument
SinkExitStatus.Error Generic error

See also:

C++ version:
Prototype:

EREMB-0xxxx-0x Pag. 130 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

SinkExitStatus Read( long chIx, __int64 sampleIx, float * value )


Parameters:
chIx Channel index
sampleIx Sample index
value Sample value
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.35 RMS Processor interface


The interface is not developed completely.

5.35.1 WindowSize
Prototype:
uint WindowSize {get; set;}
Description:
It retrieves/sets the window size (number of samples) used to carry‐out the RMS during real‐time data
processing.
Parameters:
Function return parameter:

C++ version:
Prototype:
unsigned long WindowSize
unsigned long GetWindowSize()
HRESULT get_WindowSize( unsigned long * pVal )
Parameters:
pVal Window size
Function return parameter:

Prototype:
unsigned long WindowSize

EREMB-0xxxx-0x Pag. 131 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

void PutWindowSize( unsigned long newVal )


HRESULT putref_WindowSize( unsigned long newVal )
Parameters:
newVal Window size
Function return parameter:

5.36 SensorId interface


The interface handles a SensorId object. To identify the sensor there are the following values:
• sensor type;
• color;
• label;
• MAC address.
The types of BTS sensor are:
• EMG sensor;
• AUX sensor: the sensor acquires data from electrogoniometer device (Biometrics) or from
footswitch contact areas;
• AUXEGN sensor: the sensor acquires data only from electrogoniometer device (Biometrics);
• AUXFSW sensor: the sensor acquires data only from footswitch contact areas.
There is a strong relation between type of sensor and MAC address value: a defined part of MAC address
corresponds to the given sensor type.

5.36.1 Color
Prototype:
System.Drawing.Color Color {get; set;}
Description:
It retrieves/sets the color of the sensor.
Parameters:
Function return parameter:

C++ version:
Prototype:
OLECOLOR Color
OLECOLOR GetColor()
HRESULT get_Color( OLE_COLOR * pVal )
Parameters:

EREMB-0xxxx-0x Pag. 132 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

pVal Sensor color


Function return parameter:

Prototype:
OLECOLOR Color
void PutColor( OLECOLOR newVal )
HRESULT putref_Color( OLE_COLOR newVal )
Parameters:
newVal Sensor color
Function return parameter:

5.36.2 Device
Prototype:
SensorType Device {get; set;}
Description:
It retrieves/sets the type of sensor (EMG, AUX, AUXEGN or AUXFSW).
Parameters:
Function return parameter:

C++ version:
Prototype:
SensorType Device
SensorType GetDevice()
HRESULT get_Device( SensorType * pVal )
Parameters:
pVal Type of sensor
Function return parameter:

Prototype:
SensorType Device
void PutDevice( SensorType newVal )
HRESULT putref_Device( SensorType newVal )
Parameters:

EREMB-0xxxx-0x Pag. 133 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

newVal Type of sensor


Function return parameter:

5.36.3 LabelCode
Prototype:
byte LabelCode {get; set;}
Description:
It retrieves/sets the label code for the sensor. The label code is a numeral index (from 1 to 255) for EMG
sensor, the label code is alphanumeric index (character “A” is encoded in label code 1, character “B” is
encoded in label code 2, and so on..) for AUX, AUXEGN and AUXFSW sensors.
Parameters:
Function return parameter:

C++ version:
Prototype:
unsigned char LabelCode
unsigned char GetLabelCode()
HRESULT get_LabelCode( unsigned char * pVal )
Parameters:
pVal Label code
Function return parameter:

Prototype:
unsigned char LabelCode
void PutLabelCode( unsigned char newVal )
HRESULT putref_LabelCode( unsigned char newVal )
Parameters:
newVal Label code
Function return parameter:

5.36.4 MACBytes
Prototype:
Byte[] MACBytes {get; set;}

EREMB-0xxxx-0x Pag. 134 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It retrieves/sets the MAC bytes sequence representing the MAC address. Support class for this type of data
is 64‐bit MAC address utility (EUI‐64). See Microsoft MSDN documentation for further details.
Parameters:
Function return parameter:

C++ version:
Prototype:
SAFEARRAY * MACBytes
SAFEARRAY * GetMACBytes()
HRESULT get_MACBytes( SAFEARRAY * * pVal )
Parameters:
pVal 8 element byte array representing the MAC address
Function return parameter:

Prototype:
SAFEARRAY * MACBytes
void PutMACBytes( SAFEARRAY * newVal )
HRESULT putref_MACBytes( SAFEARRAY * newVal )
Parameters:
newVal 8 element byte array representing the MAC address
Function return parameter:

5.37 SensorIdDictionary interface


The interface handles a collection of SensorId elements. The interface permits to add newe sensors to the
list, to remove existing sensors to the list and retrieve a specified sensor from the list.

5.37.1 Add
Prototype:
void add(byte[] mac, SensorId sensor)
Description:
It adds a new sensor to the list.
Parameters:
mac MAC address of sensor to add

EREMB-0xxxx-0x Pag. 135 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

sensor Sensor
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Add( SAFEARRAY * mac, struct SensorId * sensor )
Parameters:
mac MAC address of sensor to add
sensor Sensor
Function return parameter:
HRESULT COM return code

5.37.2 Clear
Prototype:
void clear()
Description:
It removes all sensors from the list.
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Clear()
Parameters:
Function return parameter:
HRESULT COM return code

EREMB-0xxxx-0x Pag. 136 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.37.3 Count
Prototype:
int count() {get;}
Description:
It retrieves the number of elements of the list.
Parameters:
Function return parameter:
count Number of elements

C++ version:
Prototype:
long Count
long GetCount()
HRESULT get_Count( long * pVal )
Parameters:
Function return parameter:
pVal Number of elements

5.37.4 Get
Prototype:
SensorId get( byte[] mac )
Description:
It retrieves the sensor for the given MAC address from the list. The sensors collection is a dictionary
structure with MAC address as key field.
Parameters:
mac MAC address of sensor to retrieve
Function return parameter:
get Sensor

See also:

C++ version:
Prototype:
ISensorIdPtr get( SAFEARRAY * mac )

EREMB-0xxxx-0x Pag. 137 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
mac MAC address of sensor to retrieve
pVal Sensor
Function return parameter:

5.37.5 Set
Prototype:
void set( SensorId sensor )
Description:
It sets the given sensor in the list. The sensors collection is a dictionary structure with MAC address as key
field.
Parameters:
sensor Sensor to set
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT set( struct ISensorId * sensor )
Parameters:
sensor Sensor to set
newVal Sensor to set
Function return parameter:
HRESULT COM return code

5.38 SensorView interface


The interface permits to retrieve the properties of sensors connected to the BM. Each BM can manage up
to a maximum of 6 sensors. The sensor types are the following: EMG, AUX, AUXEGN and AUXFSW.

5.38.1 Coding types codes


The table contains the coding type codes for sensor:
Coding type Value Description

EREMB-0xxxx-0x Pag. 138 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Raw 0 The coding is raw. The sample is acquired from the DAC and it is
converted in the allowed range values.
Envelope 2 The coding is envelope. The sample is acquired from the DAC and
it is processed to get the envelope of the measurement.
BitField 3 The coding is “bit filed”. The sample is acquired from the DAC
and it is interpreted as “bits mask”. This coding is NOT
supported.

5.38.2 Battery level codes


The table contains the battery level codes for sensor:
Coding type Value Description
Batterylow 1 The battery level is smaller than 25% of the maximum level.
BatteryMedium 2 The battery level is included between 25% and 50% of the
maximum level.
BatteryHigh 3 The battery level is included between 50% and 75% of the
maximum level.
BatteryFull 4 The battery level is greater than 75% of the maximum level.

5.38.3 Sensor Channel type codes


The table contains the codes for the type of sensor:
Coding type Value Description
NDEF 0 Type NOT defined
EMG 1 EMG sensor type.
AUX 2 Auxiliary sensor type. This sensor can acquire data from
electrogoniometers devices (Biomatrics) and from footswitch
contact areas.
AUXEGN 3 Auxiliary sensor type. This sensor accquires data only from
electrogoniometers devices (Biomatrics).
AUXFSW 4 Auxiliary sensor type. This sensor acquires data only from
footswitch contact areas.

5.38.1 SensorPlatform: codici per tipo di piattaforma del sensore


The table contains the platform ID codes for sensor:
Coding type Value Description
NDEF 0 Platform NOT defined.
EVB 1 TODO

EREMB-0xxxx-0x Pag. 139 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

P3_EMG 2 Platform for EMG sensor. First firmware release.


P3_AUX 3 Platform for AUX (AUXEGN, AUXFSW) sensor. First firmware
release.
P4_EMG 4 Platform for EMG sensor. Second firmware release.

5.38.2 SWReleaseType: codici per il tipo di versione di rilascio del software del sensore
The table contains the software release type code for the sensor:
Coding type Value Description
NDEF 0 Software configuration NOT defined. Default value.
Debug 1 Software configuration: Debug (NOT in use).
Release 2 Software configuration: Release (NOT in use).

5.38.3 Bandwidth
Prototype:
byte Bandwidth {get;}
Description:
TODO.
Parameters:
Function return parameter:
Bandwidth 0

C++ version:
Prototype:
unsigned char Bandwith
unsigned char GetBandwith()
HRESULT get_Bandwith( unsigned char * pVal )
Parameters:
Function return parameter:
pVal 0

5.38.4 BattLevel
Prototype:

EREMB-0xxxx-0x Pag. 140 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

BattLevel BattLevel {get;}


Description:
It retrieves the battery level of sensor.
Parameters:
Function return parameter:
BattLevel Battery level

C++ version:
Prototype:
BattLevel BattLevel
BattLevel GetBattLevel()
HRESULT get_BattLevel( BattLevel * pVal )
Parameters:
Function return parameter:
pVal Battery level

5.38.5 Color
Prototype:
System.Drawing.Color Color {get;}
Description:
It retrieves the color of sensor (black, red, blue, green or yellow).
Parameters:
Function return parameter:
Color Color

C++ version:
Prototype:
OLE_COLOR Color
OLE_COLOR GetColor()
HRESULT get_Color( OLE_COLOR * pVal )
Parameters:
Function return parameter:
pVal Color

EREMB-0xxxx-0x Pag. 141 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.38.6 Connected
Prototype:
bool Connected {get;}
Description:
It retrieves True if current sensor is configurated and it is belongs to the list of sensors managed from the
BM. The Connected property is checked when the BM is initialized.
Parameters:
Function return parameter:
True Sensor is configurated and connected to the BM
False Sensor is not configurated and connected to the BM

C++ version:
Prototype:
VARIANT_BOOL Connected
VARIANT_BOOL GetConnected()
HRESULT get_Connected( VARIANT_BOOL * pVal )
Parameters:
Function return parameter:
VARIANT_TRUE Sensor is configurated and connected to the BM
VARIANT_FALSE Sensor is not configurated and connected to the BM

5.38.7 Device
Prototype:
SensorType Device {get;}
Description:
It retrieves the type of sensor.
Parameters:
Function return parameter:
Device Type of sensor

C++ version:
Prototype:

EREMB-0xxxx-0x Pag. 142 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

SensorType Device
SensorType GetDevice()
HRESULT get_Device( SensorType * pVal )
Parameters:
Function return parameter:
pVal Type of sensor

5.38.8 FWVersion
Prototype:
Version FWVersion() {get;}
Description:
It retrieves the version of firmware loaded in the sensor.
Parameters:
Function return parameter:
FWVersion Version.

C++ version:
Prototype:
mscorlib::_VersionPtr FWVersion
mscorlib::_VersionPtr GetFWVersion()
HRESULT get_FWVersion( mscorlib::_VersionPtr * * pVal )
Parameters:
Function return parameter:
pVal TODO

5.38.9 LabelCode
Prototype:
byte LabelCode {get;}
Description:
It retrieves/sets the label code for the sensor. The label code is a numeral index (from 1 to 255) for EMG
sensor, the label code is alphanumeric index (character “A” is encoded in label code 1, character “B” is
encoded in label code 2, and so on..) for AUX, AUXEGN and AUXFSW sensors.
Parameters:
Function return parameter:

EREMB-0xxxx-0x Pag. 143 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

LabelCode Label code

C++ version:
Prototype:
byte LabelCode
byte GetLabelCode()
HRESULT get_LabelCode( unsigned char * pVal )
Parameters:
Function return parameter:
pVal Label code

5.38.10 MACBytes
Prototype:
byte[] MACBytes {get;}
Description:
It retrieves/sets the MAC bytes sequence representing the MAC address. Support class for this type of data
is 64‐bit MAC address utility (EUI‐64). See Microsoft MSDN documentation for further details.
Parameters:
Function return parameter:
MACBytes 8 element byte array representing the MAC address

C++ version:
Prototype:
SAFEARRAY * MACBytes
SAFEARRAY * GetMACBytes()
HRESULT get_MACBytes( SAFEARRAY * * pVal )
Parameters:
Function return parameter:
pVal 8 element byte array representing the MAC address

5.38.11 PlatId
Prototype:
SensorPlatform PlatId {get;}
Description:
It retrieves the platform ID code for the sensor. This parameter is related to the firmware of the sensor.

EREMB-0xxxx-0x Pag. 144 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Parameters:
Function return parameter:
PlatId Platform ID

C++ version:
Prototype:
SensorPlatform PlatId
SensorPlatform GetPlatId()
HRESULT get_PlatId( SensorPlatform * pVal )
Parameters:
Function return parameter:
pVal Platform ID

5.38.12 SWType
Prototype:
SWReleaseType SWType() {get;}
Description:
It retrieves the release version of firmware of sensor.
Parameters:
Function return parameter:
SWType NDEF.

C++ version:
Prototype:
SWReleaseType SWType
SWReleaseType GetSWType()
HRESULT get_SWType( SWReleaseType * pVal )
Parameters:
Function return parameter:
pVal NDEF.

5.38.13 Temperature
Prototype:

EREMB-0xxxx-0x Pag. 145 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

byte Temperature {get;}


Description:
It retrieves the temperature (°C) of sensor.
Parameters:
Function return parameter:
Temperature Temperature (°C)

C++ version:
Prototype:
unsigned char Temperature
unsigned char GetTemperature()
HRESULT get_Temperature( unsigned char * * pVal)
Parameters:
Function return parameter:
pVal Temperature (°C)

5.39 SensorViewDictionary interface


The interface handles a collection of SensorView elements. The interface permits the access of the element
of collection.

5.39.1 Get
Prototype:
SensorView get( byte[] mac )
Description:
It retrieves the SensorView object for the given MAC address. The sensors collection is a dictionary
structure with MAC address as key field.
Parameters:
mac MAC address of sensor to retrieve
Function return parameter:
get Sensor (SensorView data structure)

See also:

C++ version:

EREMB-0xxxx-0x Pag. 146 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Prototype:
ISensorViewPtr get( SAFEARRAY * mac )
Parameters:
mac MAC address of sensor to retrieve
pVal Sensor (SensorView data structure)
Function return parameter:

5.39.2 GetEnumerator
Prototype:
ISensorViewDictionaryEnum GetEnumerator()
Description:
It returns the ISensorViewDictionaryEnum interface related to the list of sensors. The
ISensorViewDictionaryEnum interface permits to access elements of SensorViewDictionary list. The
ISensorViewDictionaryEnum interface derives from IEnumerator interface. See Microsoft MSDN for a
detailed definition on IEnumerator interface
Parameters:
Function return parameter:
GetEnumerator ISensorViewDictionaryEnum interface

C++ version:
Prototype:
ISensorViewDictionaryEnumPtr GetEnumerator()
Parameters:
Function return parameter:
pVal ISensorViewDictionaryEnum interface

5.39.3 Contains
Prototype:
bool Contains(SensorView sensor)
Description:
It returns True if given sensor belongs to the list.
Parameters:
sensor Sensor (SensorView data structure)
Function return parameter:

EREMB-0xxxx-0x Pag. 147 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

True The sensor belongs to the list


False The sensor does not belong to the list

See also:

C++ version:
Prototype:
VARIANT_BOOL Contains( struct ISensorView * sensor )
Parameters:
port Sensor (SensorView data structure)
Function return parameter:
VARIANT_TRUE The sensor belongs to the list
VARIANT_FALSE The sensor does not belong to the list

5.39.4 Count
Prototype:
int count {get;}
Description:
It retrieves the number of sensors in the list.
Parameters:
Function return parameter:
count Number of elements

C++ version:
Prototype:
long Count
long GetCount()
HRESULT get_Count( long * pVal )
Parameters:
Function return parameter:
pVal Number of elements

EREMB-0xxxx-0x Pag. 148 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.40 SensorViewDictionaryEnum interface


Interface to access to list of Sensors. The list of sensors is handled by the SensorViewDictionary interface.
This interface derives from IEnumerator interface. See Microsoft MSDN for a detailed definition on
IEnumerator interface

5.40.1 Current
Prototype:
SensorView Current() {get;}
Description:
It returns the current element from the list.
Parameters:
Function return parameter:
Current Current sensor from list

C++ version:
Prototype:
ISensorViewPtr Current
ISensorViewPtr GetCurrent()
HRESULT get_Current( struct ISensorView * * pVal )
Parameters:
Function return parameter:
pVal Current sensor from list

5.40.2 MoveNext
Prototype:
bool MoveNext()
Description:
It moves to the next sensor in the list.
Parameters:
Function return parameter:
True Successful operation
False Failed operation: current element is the last element
of the list

See also:

EREMB-0xxxx-0x Pag. 149 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

C++ version:
Prototype:
VARIANT_BOOL MoveNext()
Parameters:
Function return parameter:
VARIANT_TRUE Successful operation
VARIANT_FALSE Failed operation: current element is the last element
of the list

5.40.3 Reset
Prototype:
void Reset()
Description:
It sets the enumerator pointer to initial position (before the first element of the list).
Parameters:
Function return parameter:

See also:

C++ version:
Prototype:
HRESULT Reset()
Parameters:
Function return parameter:
HRESULT COM return code

5.41 SinksFactory interface


TODO

5.41.1 CreateSink
Prototype:

EREMB-0xxxx-0x Pag. 150 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

IDataSink CreateSink(SinkType sinkType)


Description:
It creates the sink of given type (Queue, Disk, Math).
Parameters:
sinkType Sink type
Function return parameter:
CreateSink Sink (IDataSink interface)

See also:

C++ version:
Prototype:
IDataSinkPtr CreateSink ( SinkType sinkType )
Parameters:
sinkType Sink type
Function return parameter:
CreateSink Sink (IDataSink interface)

5.42 StateChangedEvents interface


This outgoing interface handles the state change of BioDAQ controller.

5.42.1 BioDAQStateChangedEventHandler
Call back function to manage the state change of controller.

5.42.2 StateChanged
Prototype:
delegate void StateChanged( object sender, BioDAQStateChangedEventArgs
eventArgs )
Description:
Delegate of state change event.
Parameters:
sender Source of event.
eventArgs Instance containing information about the event.
Function return parameter:

EREMB-0xxxx-0x Pag. 151 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

See also:
BioDAQStateChangedEventArgs interface.

C++ version:
Prototype:
HRESULT StateChanged ( const _variant_t & sender, struct
IBioDAQStateChangedEventArgs * eventArgs )
virtual HRESULT __stdcall raw_StateChanged ( VARIANT sender, struct
IBioDAQStateChangedEventArgs * eventArgs )
Parameters:
sender Source of event.
eventArgs Instance containing information about the event.
Function return parameter:

5.43 TrialReader interface


The interface permits to retrieve the data saved in a binary file with custom format. The binary file is
created during data acquisition by the Disk sink. The interface handles the binary file and it retrieves the
data.

5.43.1 CloseTrial
Prototype:
SinkExitStatus CloseTrial()
Description:
It releases the internal resources to open and manage the information data structure of binary file. The
binary file contains all the acquired data from the BioDAQ by the Disk sink.
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:

EREMB-0xxxx-0x Pag. 152 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Prototype:
SinkExitStatus CloseTrial()
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument invalid argument
SinkExitStatus_Error Generic error

5.43.2 FileName
Prototype:
string FileName {get; set;}
Description:
It retrieves/sets the full path binary file name where data are stored in the disk. The data are encoded in a
custom format.
Parameters:
Function return parameter:

C++ version:
Prototype:
_bstr_t FileName
_bstr_t GetFileName()
HRESULT get_FileName( [out, retval] BSTR * pVal )
Parameters:
pVal Full path file name
Function return parameter:

Prototype:
_bstr_t FileName
void PutFileName( _bstr_t newVal )
HRESULT putref_FileName( BSTR newVal )
Parameters:
newVal Full path file name
Function return parameter:

EREMB-0xxxx-0x Pag. 153 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.43.3 GetDataRateForType
Prototype:
SinkExitStatus GetDataRateForType( ChannelType type, out int dataRate )
Description:
It retrieves the sampling frequency for the given channel type.
Parameters:
type Channel type.
dataRate Sampling frequency
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:
Prototype:
SinkExitStatus GetDataRateForType( ChannelType type, long * dataRate )
Parameters:
type Channel type
dataRate Sampling frequency
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.43.4 GetItemInfo
Prototype:
SinkExitStatus GetItemInfo( int index, out SamplingRate samplingRate, out
int decFactor, out string name, out ChannelType type, out float
convFactor, out int offset, out int numberOfSamples )
Description:

EREMB-0xxxx-0x Pag. 154 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

It retrieves all the parameters saved in the binary file for a given channel. See IChannel interface for further
details.
Parameters:
index Channel index
samplingRate Sampling rate
decFctor Decimation factor
name Channel name
type Channel type
convFactor Conversion factor
offset ZeroLogic offset
numberOfSamples Number of samples acquired
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:
Prototype:
SinkExitStatus GetItemInfo( long index, SamplingRate * samplingRate,
float * decFactor, BSTR * name, ChannelType * type, float * convFactor,
long * offset, long * numberOfSamples )
Parameters:
index Channel index
samplingRate Sampling rate
decFctor Decimation factor
name Channel name
type Channel type
convFactor Conversion factor
offset ZeroLogic offset
numberOfSamples Number of samples acquired
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

EREMB-0xxxx-0x Pag. 155 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.43.5 GetItemSamples
Prototype:
SinkExitStatus GetItemSamples( int index, int startSampleIndex, int
numberOfSamplesToRead, out int numberOfSamplesRead, out float[] samples )
Description:
It retrieves the array of samples acquired for the given channel. The samples are stored in a increased time
index (the older in the initial position, the newer in the last position).
Parameters:
index Channe lindex
startSampleIndex Start index of samples
numberOfSamplesToRead Number of samples to read
numberOfSamplesRead Number of sample read
samples Array containing the data samples
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:
Prototype:
SinkExitStatus GetItemSamples(long index, long startSampleIndex, long
numberOfSamplesToRead, long * numberOfSamplesRead, SAFEARRAY * * samples)
Parameters:
index Channe lindex
startSampleIndex Start index of samples
numberOfSamplesToRead Number of samples to read
numberOfSamplesRead Number of sample read
samples Array containing the data samples
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

EREMB-0xxxx-0x Pag. 156 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.43.6 GetNumberOfItemsForType
Prototype:
SinkExitStatus GetNumberOfItemsForType( ChannelType type, out int
numberOfItem )
Description:
It retrieves the number of channels stored in the binary file for the given channel type.
Parameters:
type Channel type
numberOfItem Number of channels
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:
Prototype:
SinkExitStatus GetNumberOfSamplesForType( ChannelType type, long *
numberOfItem )
Parameters:
type Channel type
numberOfItem Number of channels
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.43.7 GetNumberOfVectorialSamplesForType
Prototype:
SinkExitStatus GetNumberOfVectorialSamplesForType( ChannelType type, out
long numberOfSamples )

EREMB-0xxxx-0x Pag. 157 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Description:
It retrieves the number of samples stored in the binary file for the given channel type.
Parameters:
type Channel type
numberOfSamples Number of array samples
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:
Prototype:
SinkExitStatus GetNumberOfVectorialSamplesForType ( ChannelType type,
__int64 * numberOfSamples )
Parameters:
type Channel type
numberOfSamples Number of array samples
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.43.8 NumberOfItems
Prototype:
int NumberOfItems {get;}
Description:
It retrieves the number of channels stored in the binary file.
Parameters:
Function return parameter:

C++ version:

EREMB-0xxxx-0x Pag. 158 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Prototype:
long NumberOfItems
long GetNumberOfItems()
HRESULT get_NumberOfItems( long * pVal )
Parameters:
Function return parameter:
pVal Number of channels

5.43.9 OpenTrial
Prototype:
SinkExitStatus OpenTrial()
Description:
It initializes the internal resources to open the binary file and to manage the data information structure of
binary file. The binary file contains the data acquired from BioDAQ interface by the Disk sink.
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error
See also:

C++ version:
Prototype:
SinkExitStatus OpenTrial()
Parameters:
Function return parameter:
SinkExitStatus_Success Success
SinkExitStatus_InvalidOperation Invalid operation
SinkExitStatus_InvalidArgument Invalid argument
SinkExitStatus_Error Generic error

5.43.10 StartTime
Prototype:

EREMB-0xxxx-0x Pag. 159 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

float StartTime {get;}


Description:
It retrieves the index of first sample stored in the binary file.
Parameters:
Function return parameter:

C++ version:
Prototype:
float StartTime
float GetStartTime()
HRESULT get_StartTime( float * pVal )
Parameters:
Function return parameter:
pVal First sample index

6 Sample applications
The samples are provided with the installation package. All the samples are gathered in a solution. The
solution is named Samples and it is developed in Microsoft Visual Studio 2010 environment.
C++ projects and C# projects are included in the solution.

6.1 C# samples
The samples developed in C# language are C# console applications and an application with WinForms
objects. In the code are included many comments to help the user in order to make simple the use of
BioDAQ libraries.

EREMB-0xxxx-0x Pag. 160 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Figure 3: Sample application

6.2 C++ samples


The samples developed in C++ language are Win32 console applications. In the code are included many
comments to help the user in order to make simple the use of BioDAQ libraries.

7 Technical support
Technical support is available by contacting the Customer Care Unit of BTS S.p.A sending an email to
[email protected] .

EREMB-0xxxx-0x Pag. 161 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

EREMB-0xxxx-0x Pag. 162 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

Table of Contents
1 Introduction ....................................................................................................................................... 6
1.1 Purpose of reference manual .......................................................................................... 6
1.2 System requirements.............................................................................................................. 6
1.3 Installation .............................................................................................................................. 6
2 Architecture ....................................................................................................................................... 7
3 SDK description ................................................................................................................................ 7
4 Drivers library .............................................................................................................................. 11
4.1 BM command execution status ........................................................................................ 11
4.2 Serial communication errors ........................................................................................ 12
5 Core library ..................................................................................................................................... 12
5.1 BioDAQ interface ................................................................................................................... 13
5.1.1 BioDAQ error codes .......................................................................................................... 13
5.1.2 BioDAQ exit status codes ............................................................................................ 13
5.1.3 BioDAQ state codes .......................................................................................................... 13
5.1.4 BioDAQDownload status codes .................................................................................... 14
5.1.5 Percent codes for the download data operation ......................................... 14
5.1.6 ActiveProtocol.................................................................................................................... 14
5.1.7 Arm .............................................................................................................................................. 15
5.1.8 ArmWithEvents ...................................................................................................................... 15
5.1.9 ApplyConfig ........................................................................................................................... 17
5.1.10 ApplyProfile .................................................................................................................... 17
5.1.11 ApplyProtocol .................................................................................................................. 18
5.1.12 Attach ................................................................................................................................... 19
5.1.13 BmsView ................................................................................................................................ 20
5.1.14 ChannelsView .................................................................................................................... 20
5.1.15 Download .............................................................................................................................. 21
5.1.16 DownloadAbort .................................................................................................................. 22
5.1.17 GetLastError .................................................................................................................... 22
5.1.18 Init ....................................................................................................................................... 23
5.1.19 Ports ..................................................................................................................................... 24
5.1.20 Record ................................................................................................................................... 24
5.1.21 Reset ..................................................................................................................................... 25
5.1.22 SensorsView ....................................................................................................................... 26

EREMB-0xxxx-0x Pag. 163 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.1.23 Sinks ..................................................................................................................................... 26


5.1.24 SinksFactory .................................................................................................................... 27
5.1.25 Start ..................................................................................................................................... 27
5.1.26 StartInMemoryMode ........................................................................................................ 28
5.1.27 Stop ....................................................................................................................................... 28
5.1.28 Trigger ................................................................................................................................ 29
5.1.29 UpdateStatusInfo ........................................................................................................... 30
5.2 BioDAQStateChangedEventArgs interface................................................................. 31
5.2.1 OldValue .................................................................................................................................. 31
5.2.2 NewValue .................................................................................................................................. 31
5.3 BeginDownLoad interface .................................................................................................. 32
5.3.1 BeginDownLoadEventHandler ......................................................................................... 32
5.4 BeginDownLoadEventArgs interface............................................................................. 32
5.5 EndDownLoad interface ....................................................................................................... 32
5.5.1 EndDownLoadEventHandler .............................................................................................. 33
5.6 EndDownLoadEventArgs interface ................................................................................. 33
5.6.1 State ......................................................................................................................................... 33
5.7 ProgressDownLoad interface ........................................................................................... 34
5.7.1 ProgressDownLoadEventHandler .................................................................................. 34
5.8 ProgressDownLoadEventArgs interface ..................................................................... 35
5.8.1 ProgressPercentage .......................................................................................................... 35
5.9 BMView interface ................................................................................................................... 35
5.9.1 Sensor signal latency codes .................................................................................... 35
5.9.2 BM state codes.................................................................................................................... 36
5.9.3 BM channel type codes ................................................................................................... 36
5.9.4 Platform IDs codes for BM ......................................................................................... 36
5.9.5 DataPacketSize.................................................................................................................... 36
5.9.6 Device ....................................................................................................................................... 37
5.9.7 FWVersion................................................................................................................................ 37
5.9.8 Latency .................................................................................................................................... 38
5.9.9 PANId ......................................................................................................................................... 38
5.9.10 PacketSamples .................................................................................................................. 39
5.9.11 PlatId ................................................................................................................................... 40
5.9.12 RFCh ....................................................................................................................................... 41
5.9.13 SensorsMask ....................................................................................................................... 41
5.9.14 Serial ................................................................................................................................... 42
5.9.15 SerialHex............................................................................................................................ 42

EREMB-0xxxx-0x Pag. 164 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.9.16 Sim .......................................................................................................................................... 43


5.9.17 SimPacketSamples ........................................................................................................... 44
5.9.18 State ..................................................................................................................................... 45
5.10 BMView list interface ....................................................................................................... 45
5.10.1 Contains .............................................................................................................................. 45
5.10.2 Count ..................................................................................................................................... 46
5.10.3 IndexOf ................................................................................................................................ 46
5.10.4 This[index] ....................................................................................................................... 47
5.11 Channel interface ................................................................................................................ 48
5.11.1 Channel type codes ...................................................................................................... 48
5.11.2 Measuring units codes ............................................................................................... 48
5.11.3 EMG channel range codes .......................................................................................... 48
5.11.4 EGN channel range codes .......................................................................................... 49
5.11.5 Sampling rate codes.................................................................................................... 49
5.11.1 Active ................................................................................................................................... 49
5.11.2 Coding ................................................................................................................................... 50
5.11.3 ConversionFactor ........................................................................................................... 50
5.11.4 DecimationFactor ........................................................................................................... 51
5.11.5 LogicZero............................................................................................................................ 51
5.11.6 ProtocolChannelIndex ................................................................................................. 52
5.11.7 SamplingRate .................................................................................................................... 53
5.11.8 Type ....................................................................................................................................... 53
5.12 ChannelEMG interface ......................................................................................................... 54
5.12.1 ChannelRangeCode ........................................................................................................... 54
5.12.2 Compression ....................................................................................................................... 54
5.12.3 LowPassCutOff .................................................................................................................. 55
5.12.4 SignalRange ....................................................................................................................... 55
5.12.5 Units ..................................................................................................................................... 56
5.13 ChannelEGN interface ......................................................................................................... 56
5.13.1 ChannelRangeCode ........................................................................................................... 57
5.13.2 SignalRange ....................................................................................................................... 57
5.13.3 Units ..................................................................................................................................... 58
5.14 ChannelFSW interface ......................................................................................................... 58
5.14.1 Units ..................................................................................................................................... 58
5.15 ChannelViewList interface ............................................................................................. 59
5.15.1 Contains .............................................................................................................................. 59
5.15.2 Count ..................................................................................................................................... 60

EREMB-0xxxx-0x Pag. 165 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.15.3 GetEnumerator .................................................................................................................. 60


5.15.4 IndexOf ................................................................................................................................ 61
5.15.5 SetEMGChannelsCodingType ........................................................................................ 61
5.15.6 SetEMGChannelsCompression ..................................................................................... 62
5.15.7 SetEMGChannelsHPFilterEnabling ......................................................................... 63
5.15.8 SetEMGChannelsLowPassCutOff ................................................................................ 63
5.15.9 SetEMGChannelsRangeCode .......................................................................................... 64
5.15.10 ....................................................................................... SetEMGChannelsSamplingRate
64
5.15.11 ........................................................................................................................... This[index]
65
5.16 CommandBase interface (?) ............................................................................................. 66
5.16.1 Trigger source IDs codes ........................................................................................ 66
5.17 DataSink interface .............................................................................................................. 66
5.17.1 Sink exit status codes ............................................................................................ 66
5.17.2 Sink types codes ........................................................................................................... 66
5.17.1 Arm .......................................................................................................................................... 67
5.17.2 Init ....................................................................................................................................... 67
5.17.3 Reset ..................................................................................................................................... 68
5.17.4 Start ..................................................................................................................................... 69
5.17.5 Stop ....................................................................................................................................... 70
5.17.6 Write ..................................................................................................................................... 70
5.18 DataSinkList interface .................................................................................................... 71
5.18.1 Add .......................................................................................................................................... 72
5.18.2 Clear ..................................................................................................................................... 72
5.18.3 CopyTo ................................................................................................................................... 73
5.18.4 Contains .............................................................................................................................. 73
5.18.5 Count ..................................................................................................................................... 74
5.18.6 GetEnumerator .................................................................................................................. 74
5.18.7 IndexOf ................................................................................................................................ 75
5.18.8 Insert ................................................................................................................................... 76
5.18.9 IsReadOnly ......................................................................................................................... 76
5.18.10 ....................................................................................................................................... Remove
77
5.18.11 .................................................................................................................................. RemoveAt
77
5.18.12 ........................................................................................................................... This[index]
78

EREMB-0xxxx-0x Pag. 166 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.19 DataSinksEnum interface .................................................................................................. 79


5.19.1 Current ................................................................................................................................ 79
5.19.2 MoveNext .............................................................................................................................. 79
5.19.3 Reset ..................................................................................................................................... 80
5.20 DiskSink interface .............................................................................................................. 81
5.20.1 DownloadFileName ........................................................................................................... 81
5.20.2 DownloadStart .................................................................................................................. 82
5.20.3 DownloadStop .................................................................................................................... 82
5.20.4 DownloadWrite .................................................................................................................. 83
5.20.5 FileName .............................................................................................................................. 84
5.20.6 GetProcessor .................................................................................................................... 85
5.20.7 SetProcessor .................................................................................................................... 85
5.21 EMA Processor Interface .................................................................................................. 86
5.21.1 NTimePeriods .................................................................................................................... 86
5.22 Exporter interface .............................................................................................................. 87
5.22.1 ExportData ......................................................................................................................... 89
5.22.2 ExportedFile .................................................................................................................... 89
5.22.3 TrialReader ....................................................................................................................... 90
5.23 MathSink interface .............................................................................................................. 91
5.23.1 GetProcessor .................................................................................................................... 91
5.23.2 SetProcessor .................................................................................................................... 91
5.24 PanConfig interface............................................................................................................ 92
5.24.1 PANId ..................................................................................................................................... 93
5.24.2 RFCh ....................................................................................................................................... 93
5.24.3 Serial ................................................................................................................................... 94
5.25 PanConfigList interface .................................................................................................. 95
5.25.1 Add .......................................................................................................................................... 95
5.25.2 Clear ..................................................................................................................................... 96
5.25.3 Count ..................................................................................................................................... 96
5.25.4 IndexOf ................................................................................................................................ 97
5.25.5 Insert ................................................................................................................................... 97
5.25.6 Remove ................................................................................................................................... 98
5.26 Port interface........................................................................................................................ 98
5.26.1 Serial port Baud rate codes ................................................................................ 98
5.26.1 Type ....................................................................................................................................... 99
5.27 PortCOM interface ................................................................................................................ 99
5.27.1 Baudrate .............................................................................................................................. 99

EREMB-0xxxx-0x Pag. 167 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.27.2 DataBits ............................................................................................................................ 100


5.27.3 Description ..................................................................................................................... 101
5.27.4 Handshake.......................................................................................................................... 101
5.27.5 Number ................................................................................................................................. 102
5.27.6 ParityBit.......................................................................................................................... 103
5.27.7 Portname ............................................................................................................................ 104
5.28 PortList interface ............................................................................................................ 104
5.28.1 Add ........................................................................................................................................ 104
5.28.2 Clear ................................................................................................................................... 105
5.28.3 Contains ............................................................................................................................ 106
5.28.4 Count ................................................................................................................................... 106
5.28.5 CopyTo ................................................................................................................................. 107
5.28.6 GetEnumerator ................................................................................................................ 107
5.28.7 IndexOf .............................................................................................................................. 108
5.28.8 Insert ................................................................................................................................. 108
5.28.9 IsReadOnly ....................................................................................................................... 109
5.28.10 ....................................................................................................................................... Remove
110
5.28.11 .................................................................................................................................. RemoveAt
110
5.28.12 ........................................................................................................................... This[index]
111
5.29 PortsEnum interface.......................................................................................................... 112
5.29.1 Current .............................................................................................................................. 112
5.29.2 MoveNext ............................................................................................................................ 112
5.29.3 Reset ................................................................................................................................... 113
5.30 PortsManager interface .................................................................................................. 114
5.30.1 GetAvailableSerialPorts ........................................................................................ 114
5.31 Processor interface.......................................................................................................... 114
5.31.1 Processor types codes ............................................................................................. 114
5.31.2 CalculateValue.............................................................................................................. 115
5.31.1 Type ..................................................................................................................................... 115
5.31.2 Write ................................................................................................................................... 116
5.32 Protocol interface ............................................................................................................ 117
5.32.1 Add ........................................................................................................................................ 117
5.32.2 Count ................................................................................................................................... 118
5.32.3 Clear ................................................................................................................................... 118
5.32.4 IndexOf .............................................................................................................................. 119

EREMB-0xxxx-0x Pag. 168 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.32.5 Insert ................................................................................................................................. 119


5.32.6 Item ..................................................................................................................................... 120
5.32.7 Load ..................................................................................................................................... 121
5.32.8 Remove ................................................................................................................................. 121
5.32.9 Save ..................................................................................................................................... 122
5.33 ProtocolItem interface .................................................................................................. 122
5.33.1 Protocol item state codes ................................................................................... 123
5.33.2 Channel .............................................................................................................................. 123
5.33.3 ChannelName ..................................................................................................................... 123
5.33.4 ChannelType ..................................................................................................................... 124
5.33.5 SensorChannelIndex .................................................................................................... 125
5.33.6 SensorColor ..................................................................................................................... 126
5.33.7 SensorLabel ..................................................................................................................... 127
5.33.8 SensorReference ........................................................................................................... 127
5.33.9 State ................................................................................................................................... 128
5.34 QueueSink interface.......................................................................................................... 128
5.34.1 Dequeue .............................................................................................................................. 129
5.34.2 QueueSize.......................................................................................................................... 129
5.34.3 Read ..................................................................................................................................... 130
5.35 RMS Processor interface ................................................................................................ 131
5.35.1 WindowSize ....................................................................................................................... 131
5.36 SensorId interface ............................................................................................................ 132
5.36.1 Color ................................................................................................................................... 132
5.36.2 Device ................................................................................................................................. 133
5.36.3 LabelCode.......................................................................................................................... 134
5.36.4 MACBytes ............................................................................................................................ 134
5.37 SensorIdDictionary interface .................................................................................... 135
5.37.1 Add ........................................................................................................................................ 135
5.37.2 Clear ................................................................................................................................... 136
5.37.3 Count ................................................................................................................................... 137
5.37.4 Get ........................................................................................................................................ 137
5.37.5 Set ........................................................................................................................................ 138
5.38 SensorView interface ....................................................................................................... 138
5.38.1 Coding types codes .................................................................................................... 138
5.38.2 Battery level codes.................................................................................................. 139
5.38.3 Sensor Channel type codes ................................................................................... 139
5.38.1 SensorPlatform: codici per tipo di piattaforma del sensore .... 139

EREMB-0xxxx-0x Pag. 169 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.38.2 SWReleaseType: codici per il tipo di versione di rilascio del


software del sensore ................................................................................................................ 140
5.38.3 Bandwidth.......................................................................................................................... 140
5.38.4 BattLevel.......................................................................................................................... 140
5.38.5 Color ................................................................................................................................... 141
5.38.6 Connected.......................................................................................................................... 142
5.38.7 Device ................................................................................................................................. 142
5.38.8 FWVersion.......................................................................................................................... 143
5.38.9 LabelCode.......................................................................................................................... 143
5.38.10 .................................................................................................................................. MACBytes
144
5.38.11 ....................................................................................................................................... PlatId
144
5.38.12 ....................................................................................................................................... SWType
145
5.38.13 ........................................................................................................................... Temperature
145
5.39 SensorViewDictionary interface ............................................................................... 146
5.39.1 Get ........................................................................................................................................ 146
5.39.2 GetEnumerator ................................................................................................................ 147
5.39.3 Contains ............................................................................................................................ 147
5.39.4 Count ................................................................................................................................... 148
5.40 SensorViewDictionaryEnum interface ...................................................................... 149
5.40.1 Current .............................................................................................................................. 149
5.40.2 MoveNext ............................................................................................................................ 149
5.40.3 Reset ................................................................................................................................... 150
5.41 SinksFactory interface .................................................................................................. 150
5.41.1 CreateSink ....................................................................................................................... 150
5.42 StateChangedEvents interface .................................................................................... 151
5.42.1 BioDAQStateChangedEventHandler ....................................................................... 151
5.42.2 StateChanged .................................................................................................................. 151
5.43 TrialReader interface ..................................................................................................... 152
5.43.1 CloseTrial ....................................................................................................................... 152
5.43.2 FileName ............................................................................................................................ 153
5.43.3 GetDataRateForType .................................................................................................... 154
5.43.4 GetItemInfo ..................................................................................................................... 154
5.43.5 GetItemSamples.............................................................................................................. 156
5.43.6 GetNumberOfItemsForType ........................................................................................ 157

EREMB-0xxxx-0x Pag. 170 / 171


Title: User manual BTS BioDAQ SDK ENG v.x.x.x
Project: BTS BioDAQ SDK Published: 16/06/2014

5.43.7 GetNumberOfVectorialSamplesForType .............................................................. 157


5.43.8 NumberOfItems ................................................................................................................ 158
5.43.9 OpenTrial.......................................................................................................................... 159
5.43.10 ................................................................................................................................ StartTime
159
6 Sample applications .................................................................................................................. 160
6.1 C# samples ............................................................................................................................... 160
6.2 C++ samples ............................................................................................................................. 161
7 Technical support ....................................................................................................................... 161

EREMB-0xxxx-0x Pag. 171 / 171

You might also like