P08027: Wireless Assistive Control System
/public/References/testing/

GUI

Table of Contents

This section discusses the function and use of the MATLAB GUI.

BioRadio and MATLAB GUI Setup and Use

Prerequisite: MATLAB (known to work for version 7b) must be installed.

  1. BioRadio software installation
  2. Acquire MATLAB Source Code
  3. Hardware Set-up
  4. Start-up and Instruction for GUI

BioRadio software installation

The BioRadio is very simple to install. First, ensure that you have adminsitrative permission to insall a program on your computer. Then, incert the CD in the BioRadio case into the CD-ROM drive. Next, refer to p. 11, the beginning of Chapter 2 of the CleveMed BioRadio User's Guide. The instruction at the top of page tells how to continue to install the software. Once the software installation is complete and BioRadio Lite has been confirmed to work, the next step to obtain the source code.

Acquire MATLAB Source Code

To download the source code, click on this: GUI Source Code. Be sure to save this folder under 'C:\' such that all the source code will be in a folder called 'C:\BioRadio_SDK_Matlab'.

Hardware Set-up

Directions for basic hardware set-up can be found directly below the software installation instructions in the BioRadio User's Manual. For our study we placed two electrodes across the right and left bicep and thenar muscle groups however the electrodes can be placed over any muscle. It it important to always have a ground to serve as a reference point. For out testing we used the elbow since you would be placing the electrode directly over electrically stable bone. Obviously, other parts of one's body could also serve the same purpose; the ground should be placed relatively close to the muscles being measured for convenience. Once the hardware is set-up and the BioRadio is connected to one the USB ports on the computer, find out which port that is:

  1. Go to the Desktop
  2. Right click on My Computer
  3. Go to Properties
  4. Select the Hardware tab
  5. Click on Device Manager
  6. Open the drop down (click on the plus box) for Ports (USB & LPT)
  7. Read which port the BioRadio is connected to.
  8. Write down the name of the port as COMXX.

Start-up and Instruction for GUI

Now, GUI may be opened by following these steps:
  1. Open MATLAB version 7b
  2. Type 'cd('C:\BioRadio_SDK_Matlab')' on the command line and hit enter
  3. Type 'guiVi' on the command line and hit enter
  4. A dialog box will open in which you input the port to which the Bioradio is connected, enter the name and click OK

GUI_Commport_screenshot.JPG

The GUI will then finish being generated and will take up the entire screen:

GUI_screenshot.JPG

Before collecting data, enter the name by which you want to label this data in the Name field. This will determine the name of the folder in which this data will be saved. The input range selection will indicate which gain will be applied to the data. The default is the smallest range expected, therefore the largest gain. To see the exact gain that corresponds to one of the specified ranges see this gain conversion table. The record time is determined by the number in the Time field and the Units selected. Only whole numbers can be entered into the time field (for reasons explained the MATLAB GUI debugging section in the BioRadio link on the homepage) and the units can be either seconds or minutes. The default record time is 5 seconds. To record data, click on one of the buttons on the left side of the window. The names on the buttons should correspond to the movement that the user it to perform. This aspect will also be incorporated to how the data is saved. Once the button is clicked, if the BioRadio has been set up properly, it will connect. A small window will pop-up saying that the BioRadio is connecting.

startcom.JPG

Data Acquisition begins when this message box appears and stops when the message box disappears.

data_acqstarted.JPG

If there is a problem with your connection this message will appear. Following the instructions and that should fix the problem.

error_port.JPG

If the BioRadio was successfully connected and data was recorded, the information from all four channels (excluding the first enabled channel, channel 1), the signals collected are automatically saved with all parameters in the file name in a folder called 'Name' (whatever you entered in the name field) and plotted on the graph provided on the GUI screen. The saved data is organized in the folder called Data with the BioRadio_SDK_Matlab folder. From there there are folders labeled by the date of the acquisition. Within the dated folders are the named folders. An example of a file name within one of those folders is 'Left Bicep_Run 1_5_seconds_Range 1.mat' which indicates the motion expected, which trial run, how long, and what range was used (1 corresponds to the lowest range and so on).

Program Functionality

This section describes how the program works, specifically what the primary functions are and what they do. The GUI uses three primary functions, guiVi.m, which generates the GUI, button_callback.m, which is activated when a button is pressed, and collectdata.m which connects to the BioRadio, collects data, saves and plots it. The button_callback function is used primarily to determine which button was pressed, the recording time, the configuration file to load (this includes the proper gain/range) and calls the collectdata function. The configuration files were made in BioRadio Capture Lite, the program that came with the BioRadio. The range, sampling rate, and enabled channels were specified in these configuration files. To make one, the GUI has to be closed and then open BioRadio Capture Lite with the BioRadio connected. Click the config button and a window will open. There you will see options for the smapling rate, ranges for all the channels,etc. When the desired parameters are selected click save. To incorporate these into MATLAB, follow the model beginning in the button_callback function where the configuration file is determined into where it is used in the collectdata function. The collectdata function uses the BioRadio MATLAB functions which load (connect) the BioRadio, start data acquisition, stop acquisition, read the data off the buffer, and final unload (disconnect) the BioRadio. This code is editable but a working version should be kept in case the changed version becomes non-fixable.