Writing S-Functions Previous page   Next Page
mdlSetInputPortDataType

Set the data types of the signals accepted by an input port

C Syntax

C Arguments

S
   SimStruct representing an S-Function block.

port
   Index of a port.

id
   Data type ID.

M Syntax

M Arguments

s
   Instance of Simulink.MSFcnRunTimeBlock class representing the S-Function block.

port
   Integer value specifying index of port to be set.

typeId
   Integer value specifying ID of port's data type. Use s.getDatatypeName(typeId) to get the data type's name.

Description

Simulink calls this routine to set the data type of port. The S-function must check whether the specified data type is a valid data type for the specified port. If it is a valid data type, it must set the data type of the input port. Otherwise, it must report an error using ssSetErrorStatus.

The S-function can also set the data types of other input and output ports if they are unknown. Simulink reports an error if the S-function changes the data type of a port whose data type has been set.

If the block does not implement this routine, Simulink assumes that the block accepts any data type and sets the input port data type to the specified value.

Languages

C

See Also

ssSetInputPortDataType, ssSetErrorStatus


Previous page  mdlSetInputPortComplexSignal mdlSetInputPortDimensionInfo Next page

© 1994-2005 The MathWorks, Inc.