Code covered by the BSD License  

Highlights from
ECALS (supervisory control of fermentors)

ECALS (supervisory control of fermentors)

by

 

30 Aug 2012 (Updated )

Enables supervisory control of bioreactors using arbitrary MATLAB functions via OPC

...
function [terminateFlag saveStateFlag logFlag caOutputs] = ...
wait_minutes( ...
    recipestepObj,...
    masterRecipeObj,...
    initFlag,...
    restartFlag,...
    runTime,...
    ~)  %#ok<INUSL>
%%
%CA
%CA  INPUTS
%CA  OUTPUTS
%CA  PARAMETERS
%CA     min_to_wait double 60


%% BEGIN LOCAL VARIABLE ASSIGNMENT 
% default values for ECALS
saveStateFlag = false; % if true then a recovery point will be saved
logFlag = false;
terminateFlag = false;  
caOutputs = 0;

% Inputs

% Parameters
min_to_wait = recipestepObj.caParamStruct.min_to_wait.value;

%% END LOCAL VARIABLE ASSIGNMENT 

%% Initialization
% only if this is the first function call
if initFlag
    recipestepObj.caData.startTime = runTime;
end

%% MAIN
% how long since this function was first called
elapsedTime = runTime - recipestepObj.caData.startTime;

% run until elapsedTime is up
if (elapsedTime)/60 >= min_to_wait
    terminateFlag = true;
end

Contact us