image thumbnail
from Two-Syringe MED Perfusion System by Matthew A. I. Ua Cruadhlaoich
Instructions and m-files for setting up a remote-controlled multielectrode dish perfusion system.

mediumrefresher.m
%% Medium Refresher
% This is an m-file for replacing the medium bathing cells on an MED plate with fresh,
% glial-conditioned medium to promote the long-term viability of the culture.  The
% program replaces a 1 mL volume of medium by controlling one Harvard Apparatus mL Flow
% Modular Pumping Component (MPC) via serial port COM1 and sending TTL pulses out the
% parallel port to pin 4 of a Parker Hannifin Valve Driver II terminal strip to control
% a vacuum-line valve.

% Copyright 2004 - 2007 Matthew A. I. Ua Cruadhlaoich


% Creates a digital I/O object named "valveswitch" associated with the parallel port LPT1.
valveswitch = digitalio('parallel','LPT1');
% Adds output hardware line 2 (which corresponds to parallel port pin 4) to valveswitch.
addline(valveswitch,2,'out');

% Creates a serial port object named "pump1" linked to serial port COM1.
pump1 = serial('COM1');
% Communication settings taken from p. 9 of the mL Flow MPC manual (1 start bit is sent by
% default).
set(pump1,'BaudRate',9600,'DataBits',8,'Parity','none','StopBits',2);
fopen(pump1)

% Clears syringe pump 1 volume accumulator to zero.
fprintf(pump1,['CLV' char(13)]);
pause(1)
% Sets diameter of syringe in mm.  (Flow rate is reset to 0 following this command.)
fprintf(pump1,['MMD 26.7' char(13)]);
pause(1)
% Sets syringe pump 1 flow rate to max for B-D 60 mL syringe, in mL/min (26.56, from pp.
% 12-13 of the MPC manual).
fprintf(pump1,['MLM 26.56' char(13)]);
pause(1)
% Sets syringe pump 1 target volume to 1 mL.
fprintf(pump1,['MLT 1' char(13)]);
pause(1)

% Begins sucking off old medium.
putvalue(valveswitch,1);

pause(10)

% Ends sucking.
putvalue(valveswitch,0);

% Infuses 1 mL of medium.
fprintf(pump1,['RUN' char(13)]);
pause(3)

% Clears syringe pump 1 volume accumulator to zero.
fprintf(pump1,['CLV' char(13)]);
pause(1)

% Removes valveswitch from memory and from the workspace.
delete(valveswitch)
clear valveswitch

% Closes pump1, clears it from memory, and removes it from the workspace.
fclose(pump1)
delete(pump1)
clear pump1

Contact us at files@mathworks.com