Download Latest Version sm Data Acquisition.zip (115.2 MB)
Email in envelope

Get an email when there's a new version of Microfluidic SM Formulator Controller

Home / Labview Drivers
Name Modified Size InfoDownloads / Week
Parent folder
USBIO24.llb 2010-12-14 120.0 kB
ReadMe.txt 2010-12-14 6.3 kB
Totals: 2 Items   126.3 kB 0
SOFTWARE FOR THE 24-VALVE CONTROLLER
------------------------------------
Rafael Gómez-Sjöberg
Quake Lab - Stanford University
7/6/06


This document provides a brief description of the software provided to
use the solenoid valve controller from either LabView or Matlab.

Driver for USB interface:
-------------------------

In order to use the controller box, you need drivers for the USB
communication. You can download the latest version of the "D2XX"
drivers from: http://www.ftdichip.com/Drivers/D2XX.htm Check the link
for Installation Guides if you need help with the drivers.

IMPORTANT: In the FTDI web page there are two kinds of drivers
available: The "D2XX" and the "Virtual COM Port" (VCP). The LabView
and Matlab software supplied with these instructions was designed to
work exclusively with the "D2XX" drivers. Do *NOT* install the Virtual
COM Port (VCP) drivers!!! INSTALL ONLY THE D2XX DRIVER.

If you want to write your own functions for interfacing with the
controller box, examples of using the D2XX drivers from several
programming languages can be found at:
http://www.ftdichip.com/Projects/CodeExamples.htm

Information specific to the USBIO24 board from Elexol can be found in
the board's manual available at:
http://info.hobbyengineering.com/specs/ELEXOL-USBIO24-M3.PDF or
http://www.elexol.com



LABVIEW LIBRARY:
-----------------

The folder LabView contains two librabries, USBIO24.llb and VC.llb,
with basic sub-VIs to control the valves plus some simple example VIs
that show how to use the sub-VIs.

The VIs in the USBIO24.llb library are the lowest level routines for
communicating with the valve controller box. You start by opening a
connection with a box using USBIO24_open_setup_by_idx or
USBIO24_open_setup_by_sn (depending on whether you wan to indicate
which controller box to talk to by it index or by its serial number,
respectively). The you can use routines like USBIO24_set_bits to set
the state of some or all valves connected to a box. At the end of your
program, you should call USBIO24_close to close the communication and
set the controller box free.

Start by checking the VI named 24BitWrite_idx.vi. That's a very simple
VI that controls all 24 valves in a box. It shows you how to
initialize the box and send data to it, and read data back. When you
connect several boxes to the computer each box gets an index number
that starts at 0. In the "Device Index" control box you choose which
box to talk to. The serial number and descriptions returned by the box
are displayed on the screen.

When you have more than one box connected, it's not advisable to talk
to the boxes using the device index (if you unplug and plug the boxes
the indexes change). It's better to talk to the boxes using their
serial numbers, that way you are always sure you are talking to the
right box (you can get a box's serial number using 24BitWrite_idx.vi).
For that, you can use the VI's in the library VC.llb. Those VIs
implement a higher level of abstraction for handling as many boxes as
you want simultaneously. The input to all the VC_* VIs is a bundle
with two elements: the number of controller boxes connected and array
of bundles that will contain info specific to each controller. Each
bundle in the array contains a serial number that you specify, a
handle that is internally generated, a status flag that tell you if
everything is OK, and a manifold polarity array. The manifold polarity
specifies if the valves on the manifold are normally open (high
pressure is applied when power is off, atmospheric pressure is applied
when power is on) or normally closed. When you have several boxes
connected, the first box in the array has valves numbers 0-23, the
second box has 24-47, etc. So the VC_* VIs make several boxes look
like a single bog box by having a single numbering sequence. If you
tell the VI to close valve 54, it will automatically decide which
controller box to talk to. You just need to get the serial numbers of
all the boxes (I would write them on the boxes so that you always see
them) and enter the numbers in the array in the order you want.

To write your own VIs you can use the pre-defined controls VC_bit.ctl,
to place a single valve control on the front panel, and
VC_valve_controllers.ctl, to place the bundle with the valve
controller information (number of boxes, serial numbers, etc.) on the
front panel.

The VI 48-valve-control.vi is an example of how to use two controller
boxes as a virtual 48-valve box with the VC_* functions.

LabView examples of many other commands that the D2XX driver accepts
can be donwloaded from:
http://www.ftdichip.com/Projects/CodeExamples/LabVIEW.htm


MATLAB LIBRARY:
---------------

The folder Matlab contains functions that mirror those written for
LabView (read the LabView section above). Each function has comments
embedded that provide basic information on how to use them. Type "help
usbio24_{function}" of "help vc_{function}" to get help on how to use
any function.

The folder with these functions must be included in your Matlab path
before you can use any of the functions.

If you get an error regarding the "FTD2XX.dll" library when you run
the fucntions, you might need to find the file FTD2XX.dll in the
Windows directory (typically in c:\Windows\system32) and make a copy
of it in the same folder where you have the usbio24_*
functions. Remember that if you update the driver installation you
will have to re-copy the FTD2XX file.

The file "myFTD2XX.h" must be in the same folder as the usbio24_8
functions.


--------------------------------------------------------------------


This information is provided “as-is” without any explicit or implied
warranties as to its accuracy, safety, and applicability to any
specific purpose. The author, the Quake Lab, and Stanford University
should not bear any responsibility for any use given by third parties
to this information, and to the devices herein described. The user of
this information and the devices herein described shall assume full
responsibility for all aspects of their use.  Please do not
re-distribute this information. If other people inquire about it,
please refer them to our web site: http://thebigone.stanford.edu
Source: ReadMe.txt, updated 2010-12-14