From: Christian Komposch on 20 Apr 2010 08:11 Hi, did you find a solution for this problem? Thanks in advance, Christian Komposch "Marcos Liso Nicolas" <liso(a)ifn.ing.tu-bs.de> wrote in message <hkrqbt$m20$1(a)fred.mathworks.com>... > > Hi Hans, > I am having the same problem, did you find a solution?? > > Regards > > > "Hans Gohle" <ghostryder(a)gmx.de> wrote in message <gl4bta$4r1$1(a)fred.mathworks.com>... > > Hi, > > > > I'm trying to create an s-function that has no input port but 2 output ports. Therefore I setup the setup-function as follows: > > > > setup() > > > > .... > > block.NumInputPorts = 0; > > block.NumOutputPorts = 2; > > > > block.OutputPort(1).DatatypeID = 0; > > block.OutputPort(1).Complexity = 0; > > > > block.OutputPort(2).DatatypeID = 0; > > block.OutputPort(2).Complexity = 0; > > > > block.OutputPort(1).Dimensions = x; > > block.OutputPort(2).Dimensions = y; > > .... > > > > When I try to run the model containing that function I get an error: > > > > 's-function xxxxxxx cannot have dynamic frame data setting for its output port 1. All sources should explicitly set all their output ports to be frame or non-frame.' > > > > The interesing thing is, if I set the input port number to 1 everything's fine... Can someone please give me an idea what's wrong in the upper implementation? > > > > Thank you, g.
From: Eugenio on 22 Apr 2010 22:22 Hi, I solved this problem using this function setup(block) %% Register number of input and output ports block.NumInputPorts = 0; block.NumOutputPorts = 1; %% Setup functional port to default block.SetPreCompPortInfoToDefaults; %% Setup output port block.OutputPort(1).Dimensions = X; %% Set block sample time to continous block.SampleTimes = [ 0 0 ]; %% Register parameters block.NumDialogPrms = Z; %% Check Parameters CheckPrms( block ); %% Run accelerator on TLC block.SetAccelRunOnTLC(true); %% Register methods block.RegBlockMethod('Outputs', @Output); block.RegBlockMethod('SetInputPortSamplingMode', @SetInpPortFrameData); block.RegBlockMethod('CheckParameters', @CheckPrms); %endfunction I hope this will help you Eugenio "Hans Gohle" <ghostryder(a)gmx.de> wrote in message <gl4bta$4r1$1(a)fred.mathworks.com>... > Hi, > > I'm trying to create an s-function that has no input port but 2 output ports. Therefore I setup the setup-function as follows: > > setup() > > .... > block.NumInputPorts = 0; > block.NumOutputPorts = 2; > > block.OutputPort(1).DatatypeID = 0; > block.OutputPort(1).Complexity = 0; > > block.OutputPort(2).DatatypeID = 0; > block.OutputPort(2).Complexity = 0; > > block.OutputPort(1).Dimensions = x; > block.OutputPort(2).Dimensions = y; > .... > > When I try to run the model containing that function I get an error: > > 's-function xxxxxxx cannot have dynamic frame data setting for its output port 1. All sources should explicitly set all their output ports to be frame or non-frame.' > > The interesing thing is, if I set the input port number to 1 everything's fine... Can someone please give me an idea what's wrong in the upper implementation? > > Thank you, g.
|
Pages: 1 Prev: Simulink RTW error Next: Possible to extract data matrix from plot figure? |