Documentation

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 byS. Must be a nonnegative integer.

Returns

布尔valuetrueif successful. Otherwise, returnsfalse.

Description

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

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

wheressSetNumOutputPortsreturns0ifnOutputPortsis 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-functionsfun_port_constant.cused insfcndemo_port_constant.

Introduced before R2006a