Using the spinapi to control SpinCore Technologies, Inc. products


    This document describes how to interface with the spinapi control library, which is used to control all of our products. The spinapi control library is a standard windows .dll which can be accessed from a wide variety of programming environments, such as C/C++ programs, etc.

Accessing spinapi from a C/C++ program

    This section describes the basic steps needed to get your C/C++ program to work with spinapi.  Virtually any C/C++ compiler/programming environment is compatible, feel free to use your favorite.  If you do not currently have a C/C++ compiler, there are several high quality compilers available for free download on the internet, see below for some recommendations.

 Four files are necessary to be able to control your board using this approach.

.c/.cpp file: This is the program itself. Several example C programs are included for each of our different products.

spinapi.h: The spinapi header file. This contains the function declarations and definitions which are needed to access the spinapi functions. This should be #included in all files which use the spinapi functions. (#include "spinapi.h")

Import library: This library must be linked with your program so it will know to look inside the spinapi.dll file to find the API functions. There are several different file formats for import libraries, so we have provided three different ones so that all compilers can be supported. Choose whichever is appropriate for the compiler you are using.

    libspinapi.a: GCC based compilers (such as MinGW)



General Tips

  • We highly recommend you check the result of the pb_get_version() function at the beginning of each program. This way, if you upgrade to a newer version of spinapi, you can check to make sure your program is not accidentally still using the older version of the library.

  • Checking the return value of all spinapi functions is highly recommended. This way you will be able to detect common errors (such as entering too short a time for an instruction length, etc.)

  • If you encounter difficulties controlling your board with spinapi, you can enable debugging features by calling pb_set_debug(1) on the first line of your program. This will create file called log.txt when you run your program, which can then be emailed to us along with a description of the problem to help us solve your problem as quickly as possible.

Contact Info

SpinCore Technologies, Inc. 
4623 NW 53rd Avenue, SUITE 5 
Gainesville, FL 32653 
USA 

Phone:    (USA) 352-271-7383 
Fax:      (USA) 352-371-8679 
Internet: http://www.spincore.com