Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

ssSetNumOutputPorts

Specify the number of output ports that a block has

Syntax

boolean_T ssSetNumOutputPorts(SimStruct *S, int_T nOutputPorts)

Arguments

S

SimStruct representing an S-Function block.

nOutputPorts

Number of output ports on the block represented by S. Must be a nonnegative integer.

Returns

The Boolean value true if successful. Otherwise, returns false.

Description

Use in mdlInitializeSizes to set the number of output ports to a nonnegative integer. Invoke the function using

if (!ssSetNumOutputPorts(S,nOutputPorts)) return;

where ssSetNumOutputPorts returns 0 if nOutputPorts is negative or an error occurs while creating the ports. When this occurs, and you return out of your S-function, the Simulink® engine displays an error message.

Languages

C, C++

Example

See the S-function sfun_port_constant.c used in sfcndemo_port_constant.

Introduced before R2006a

Was this topic helpful?