xxsimRemovePort - Remove the specified port form the specified submodel. Syntax: retval = xxsimRemovePort(submodelName, portName) Inputs: submodelName = Name of the submodel to obtain the port definitions from. portName = Name of the new port to add Outputs: retval = true on success, false on failure Examples: retval = xxsimRemovePort('PID', 'output') - removes the 'output' output signal from the submodel "PID". Author: Controllab Products B.V. Email: info@controllab.nl Website: https://www.20sim.com January 2021
0001 function retval = xxsimRemovePort(submodelName, portName) 0002 % xxsimRemovePort - Remove the specified port form the specified submodel. 0003 % 0004 % Syntax: 0005 % retval = xxsimRemovePort(submodelName, portName) 0006 % 0007 % Inputs: 0008 % submodelName = Name of the submodel to obtain the port definitions from. 0009 % portName = Name of the new port to add 0010 % 0011 % Outputs: 0012 % retval = true on success, false on failure 0013 % 0014 % Examples: 0015 % retval = xxsimRemovePort('PID', 'output') 0016 % 0017 % - removes the 'output' output signal from the submodel 0018 % "PID". 0019 % 0020 % Author: Controllab Products B.V. 0021 % Email: info@controllab.nl 0022 % Website: https://www.20sim.com 0023 % January 2021 0024 0025 %------------- BEGIN CODE -------------- 0026 % Check the obtained amount of input arguments. 0027 if(nargin<2) 0028 error('Not enough input arguments were specified.'); 0029 end; 0030 0031 % Check if the submodelName is a string. 0032 if(~ischar(submodelName)) 0033 error('Please specify a valid submodel name.'); 0034 end; 0035 0036 % Check if the portName is a string. 0037 if(~ischar(portName)) 0038 error('Please specify a valid port name.'); 0039 end; 0040 0041 % invoke 20-sim with the xmlrpc call 0042 retval = xrlinvoke('xxsim.model.removePort', struct('submodelName', submodelName, 'portName', portName)); 0043 end