Aller au contenu

Biopac modules

The BIOPAC modules are compatible with VRmaze from version 2023 onwards via the Hardware API (MPDev.dll).

Compatibility

Based on the MPDev.Dll file, VRmaze supports the MP36, MP150 and MP160 modules.

Installation

BIOPAC modules require the copy of a file in the VRmaze installation folder. This file is provided by BIOPAC, which owns it. It is necessary to copy the MPDev.dll file into the VRmaze installation folder (%InstallFolder%\VRmazeViewer_Data\Plugins\x86_64\).

MPDev.dll file

The MPDev.dll file is necessary for the operation of the BIOPAC module directly in VRmaze. This file is the property of BIOPAC and is not integrated in the VRmaze installer. Ask BIOPAC or its reseller for more information.

Library Version

The X64 version of the MPDev.dll file must be copied to run in VRmaze.

Communication system

The MPDev.dll library allows communication with a BIOPAC module of type MP36, MP150 or MP150, either via the UDP protocol (RJ45 connector) or USB, however, it is preferable to use a UDP communication in direct.

Live communication

Depending on the network system, it is preferable to connect the BIOPAC module directly to the computer without using a switch or router. Without a DHCP server, the BIOPAC module will take the following fixed IP address: 169.254.XXX.XXX. In order to work with VRmaze, BIOPAC advises to assign the following IP address to the computer: 169.254.111.111 with a subnet mask of 255.255.0.0.

How it works in VRmaze

In VRmaze, the use of a BIOPAC module differs only slightly from the use of another device. The system consists of two main nodes, a manager and a recorder. The manager handles the communication with the module and the recorder stores the received data.

Communication Manager

The communication manager with the module allows you to set the following options:

  • Type of communication (USB or UDP)
  • Module type (MP36, MP150 or MP160)
  • The serial number of the equipment (Set AUTO for automatic detection)
  • The profile file (xml file)
  • The frequency (set to 5000Hz maximum)

Image title 2

The BIOPAC module manager.

Acquisition frequency

The acquisition frequency is voluntarily clamped at 5000Hz maximum. Tests in VRmaze show that a conventional computer can remain stable up to 10Khz for 16 channels and becomes unstable with a frequency of 20Khz for a number of channels greater than 9.

Acquisition frequency vs. recording frequency

Each recording node has its own subsampling, so as to lighten the pass file.

Profile file

The profile file is a file proposed by BIOPAC and exploitable by the MPDev library. This file contains acquisition profiles for each type of equipment.

Image title 2

The contents of the profile file

Where are my data?!?

The large volume of data generated by the BIOPAC module (depending on the acquisition frequency) is a problem. The proposed solution is independent of conventional recording nodes. Indeed, the BIOPAC module manager has its own acquisition file recording system. This file contains all the information on all the channels during the whole protocol. The particularity of this recording is that it can be extremely voluminous.

The manager writes a file in binary form in the Results folder. This data file is not directly read back when a pass file is opened. It is accessible and can be converted to a CSV file (even larger...) for external analysis.

Binary file weight

The generated binary file can be extremely heavy. For example, 10 minutes of recording at 5khz on 16 channels produces a file of 500Mb of data.

Full recording

The purpose of this parallel recording system is to be able to give access to all the data generated by the module, without loss.

Exploitation of the binary recording file

The structure of the generated binary file is very simple. The file has no header, and the first bytes give information on the data sequence of the file: Reading an integer at offset 0 indicates the number of recorded channels. Reading an integer at offset 0+sizeof(int) indicates the number of records in the file. After these two integers, the rest is just a sequence of double precision numbers. Each record always starts with the timecode value, followed by all recorded channels.

VRmaze provides a tool to take the file associated with a manager and convert it to a csv file for exploitation in text form.

Image title 2

The tool for converting binary data to csv file.

Configuration of acquisition channels

VRmaze offers the possibility to simply configure the BIOPAC module by indicating which channels to activate. To do this, the BIOPAC module manager has two configurable channel lists, one for analog acuiqisition (value range), the second for digital acquisition (0 or 1).

Each analog channel has only 3 parameters:

  • The channel number (from 1 to 16)
  • The profile to be used
  • The activation of this channel

Image title 2

Configuring an acquisition channel.

Each digital channel simply has 2 parameters:

  • The channel number (from 0 to 15)
  • The activation of this channel

Channel profile

The channel profile is used to tell the MPDev library to transform the data stream before sending it back to VRmaze. The Xml file of profiles contains a set of profiles for analog acquisition that can be associated with each channel.

To associate a profile, simply copy the value of its uid parameter:


    <analogpreset uid="a102">
        ...
    </analogpreset> 

Data recording

As in any other protocol, the recorded data are integrated into the trials. Therefore, a recording node must be added as a test entity. There are two different nodes for recording, the analog recording node and the digital recording node. The options for these nodes are as follows:

  • The channel to record
  • The subsampling level
  • The option to record all channels at once.

Image title 2

The analog recording node.

Recording all channels

Recording all channels is an option to group all channels configured in the BIOPAC module manager. In this case, the channel ID to be recorded is ignored and all channels are recorded with the given subsampling.

multiple recording nodes ?

It is quite possible to add multiple recording nodes in each trial, or even multiple recorders for a given channel (although this is not useful). This allows channels to be recorded at different frequencies.

Subsampling

The recorder node allows you to downsample to allow for lighter, more accurate acquisition. The rule is simple: The management node sets a common acquisition frequency for all channels, the recording node allows to store the values of a channel at a different frequency. The subsampling value divides the overall frequency to obtain a recording frequency. For example, a global acquisition frequency of 1000hz and a subsampling of 2 causes a recording at 500hz (1000/2).

Subsampling

Subsampling is important. The volume of data can cause much longer file manipulations and result analysis if the subsampling is not calibrated to the needs. Please always try to maximize the subsampling, no matter what, the record file will contain all the data without subsampling.

Controlling the module's outputs

VRmaze offers the possibility to control the analog and digital outputs of the BIOPAC module. To do this, two nodes are available (one for the digital node, one for the analog node). The options of these nodes are the following:

  • The output channel
  • The value to apply (floating for the analog node, binary [0 or 1] for the digital control node)

Image title 2

The analog output control node.

Digital Output

The difference between the two types of outputs lies in the fact that the digital output accepts only two distinct values: 0 or 1. On the other hand, the animation controller allows floating variation. In this case, any value greater than 0.5 will be considered as 1, otherwise 0.

Variation of the output value

The interest of these two nodes consists in being able to animate the output value over time. Indeed, each node has an animation controller allowing to control the value sent to the output. This makes it possible to vary the value of the output directly from VRmaze.