Using a structure for block masked parameters the xml does not generate a start value for the model yielding an error loading the FMU (v2).
Suggested Fix although hacky:
Line 189 of grtfmulib.tlc
Replace %assign startAttr = ""
With %assign startAttr = FEVAL("grtfmi_get_start_value_workspace",variableName,rowid,colid)
And use the following matlab function:
function value = grtfmi_get_start_value_workspace(variableName,iCol,iRow)
if (strfind(variableName,'Parameters.')==1)
var = sprintf('%s(%d,%d)',variableName(12:end),iCol+1,iRow+1);
try
value = sprintf(' start="%g" ', evalin('base',var));
catch
warning('Variable not in base workspace: %s',var);
value = ' ';
end
else
value = ' ';
end
Not typically a TLC author so there may be an elegant way to do this in the TLC language and add checks for variable scope.
Using a structure for block masked parameters the xml does not generate a start value for the model yielding an error loading the FMU (v2).
Suggested Fix although hacky:
Line 189 of grtfmulib.tlc Replace
%assign startAttr = ""
With%assign startAttr = FEVAL("grtfmi_get_start_value_workspace",variableName,rowid,colid)
And use the following matlab function:
Not typically a TLC author so there may be an elegant way to do this in the TLC language and add checks for variable scope.