August 23, 2015

Install and Test OSX Installation

Contents

Preamble

"RingBuffer" is the new name for the BioSemi library that was formerly called "Labview_DLL". The new name was chosen to remove any inference that the library comes from or, is dependent on, the National Instruments "LabVIEW" product.

This software contains no kernel mode routines and runs entirely in user mode.

The BioSemi Mac software is distributed here in both prebuilt binary form - for Intel MAC OSX 10.10 (Yosemite) and later - and with a Makefile so that it can be rebuild to run with updated components.

The low level software needed to access the USB sample stream generated by the BioSemi acquisition hardware consists of 2 libraries:

Prebuild binary files are located in the "OSX32" and "OSX64" subdirectories. The first set of instructions below give the steps required to use these pre-built binary files, see Install.

If these binary files don't work, try rebuilding them from the available source, see Rebuilding the binary files.

Install

A more permanent arrangement for the libRingBuffer and libusb shared libraries is to put them in /usr/local/lib. This removes the need to have to repeatedly setup the DYLD_LIBRARY_PATH environment variable to be able to find these shared libraries.

Once this test program works, follow the instructions in Try Client/Server if you want to try the client/server mode of operation.

Some performance improvement may be gained by using the library parameters explained at Tuning.

Merging with ActiView or Other Existing Application

RingBuffer_SyncTest Usage

This program checks that the 0xffffff00 sync words appear in all the right places in the input stream. It stops with a message if they don't.

There can be 3 command line parameters for this program:

These parameters can be in any order or left out completely.

Hitting CTRL-C when the program is running will stop the run.

Rebuilding the binary files

To rebuild the binary files Apple's program development package "Xcode Tools" must be installed. This package can be downloaded through the internet from the App Store.

Then perform the following steps to build first the libusb-1.0 library and then the RingBuffer library. In these instructions the bash shell is assumed.

Develop a Program

To develop your own acquisition program using the RingBuffer library, see RingBufferLibrary-API for a description of the API's available.

The distributed software was compiled and tested in both 32 and 64 bit modes using an Intel based MAC running OSX 10.10.5 (Yosemite). The Xcode compiler on this system is version 6.4.

ReCreate the Framework for use with LabVIEW or Other Program

LabVIEW for OSX requires user Call Libraries be in a framework. National Instruments' latest instructions for creating such a framework are given at:

http://digital.ni.com/public.nsf/allkb/A6A6371FE0EA333B86257015005E3400

These instructions are reproduced below:

1. Open Xcode.
2. Select File » New Project.
3. Select the Framework & Library » Cocoa Framework template.

Note: LabVIEW supports the use of Frameworks that use the Carbon API, and does not support
Frameworks that use the Cocoa API. However, since the Carbon Framework template has been
deprecated in current versions of Xcode, you can use the Cocoa Framework template to start
the project. 

Again, Frameworks called by LabVIEW should not call the Cocoa API on Mac OS X. LabVIEW does
not use Cocoa, and therefore does not initialize this API. Using this API inside Frameworks
may result in unpredictable behavior.

4. Name the framework when prompted (e.g. MyFramework). Click Next.
5. Specify the location of the project on disk. Click Create. 
6. Make sure that the project is set to build a 32-bit or 32/64-bit Universal Framework. LabVIEW
for Mac OS X cannot load 64-bit frameworks. Within the Project Navigator select the Project
item in the tree (e.g. MyFramework), select the Project in the Settings area, and select the
Build Settings tab.
Make sure that the selected build architecture is 32-bit or standard (32/64-bit Intel).

For our purpose, use this variation to these instructions:

Outside of Xcode, copy the newly created framework to the directory where you intend to use it. Rename it at this stage if necessary.

Do this to make the framework portable so it can be used on other similar computers (replace the 32's with 64's if building a 64 bit version):