%volume1 - forward
%volume2 - reverse
%volume3 - forward
function [out] = syringe_mix(volume1, volume2, volume3)

SYRINGE_SIZE = 500;
MAX_STEPS = 3000;
NUM_REPEATS = 5;
INITIALIZE_VALVE = 'Y';
PORT = 'COM5';
PULL_SPEED = 27;
PULL_SPEED2 = 27;%25 equals a speed of 500ul in 50sec (timed) w/ autosampler syringe
EMPTY_SPEED = 8;

volume2 = volume1 - volume2;
volume3 = volume2 + volume3;

pull_steps1 = round((double(MAX_STEPS) / double(SYRINGE_SIZE)) * double(volume1));
pull_steps2 = round((double(MAX_STEPS) / double(SYRINGE_SIZE)) * double(volume2));
pull_steps3 = round((double(MAX_STEPS) / double(SYRINGE_SIZE)) * double(volume3));

out = cavro(['/1IS' num2str(PULL_SPEED) 'A' num2str(pull_steps1) 'M1000R'], PORT);
for(i=1:NUM_REPEATS)
out = cavro(['/1IS' num2str(PULL_SPEED2) 'A' num2str(pull_steps2) 'M1000R'], PORT);
out = cavro(['/1IS' num2str(PULL_SPEED) 'A' num2str(pull_steps3) 'M1000R'], PORT);
end

out = cavro(['/1OS' num2str(EMPTY_SPEED) 'A0R'], PORT);



