xxsimSaveModel

PURPOSE ^

xxsimSaveModel - saves the changes made to active 20-sim model.

SYNOPSIS ^

function [result] = xxsimSaveModel(varargin)

DESCRIPTION ^

 xxsimSaveModel - saves the changes made to active 20-sim model.

 Syntax: 
   result = xxsimSaveModel(fileName)

 Inputs:
   fileName = (Optional) directory path to which the model should be saved .
              Note: entering an empty string saves the model under its current name
                    if it has any (default).

 Outputs:
   result = boolean indicating the success.

 Examples:
   result = xxsimSaveModel('C:\temp\test.emx')
   
      - saves the current model to the file 'test.emx'
 
 See also: xxsimOpenModel, xxsimCloseModel, xxsimSaveSubmodel

 Author: Controllab Products B.V.
 email: info@controllab.nl
 Website: http://www.controllab.nl
 November 2015

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [result] = xxsimSaveModel(varargin)
0002 % xxsimSaveModel - saves the changes made to active 20-sim model.
0003 %
0004 % Syntax:
0005 %   result = xxsimSaveModel(fileName)
0006 %
0007 % Inputs:
0008 %   fileName = (Optional) directory path to which the model should be saved .
0009 %              Note: entering an empty string saves the model under its current name
0010 %                    if it has any (default).
0011 %
0012 % Outputs:
0013 %   result = boolean indicating the success.
0014 %
0015 % Examples:
0016 %   result = xxsimSaveModel('C:\temp\test.emx')
0017 %
0018 %      - saves the current model to the file 'test.emx'
0019 %
0020 % See also: xxsimOpenModel, xxsimCloseModel, xxsimSaveSubmodel
0021 %
0022 % Author: Controllab Products B.V.
0023 % email: info@controllab.nl
0024 % Website: http://www.controllab.nl
0025 % November 2015
0026 
0027 %------------- BEGIN CODE --------------
0028     %check input arguments
0029     modelFilename = '';
0030     if length(varargin)==1
0031 
0032         if ~ischar(varargin{1})
0033             error('Input argument 1 should be a file name.');
0034         else
0035             modelFilename = varargin{1};
0036         end
0037     elseif length(varargin) > 1
0038         error('This function expects only 1 (optional) input argument.');
0039     end
0040 
0041     % set the result varaible
0042     result = true;
0043 
0044     reply = xrlinvoke('xxsim.saveModel', struct('name', modelFilename));
0045     if (length(reply) == 0 )
0046         error('could not save the model');
0047     end
0048 
0049     % return the succes
0050     result = true;
0051 end
0052 %------------- END OF CODE --------------

Generated on Sun 10-Dec-2017 19:24:51