Main Content

Symbol

C Function block data symbol

Description

Define C Function block symbols and their properties.

Creation

Access a Symbol object through one of the following methods.

Properties

expand all

Symbol name in source code, specified as a character vector.

Data Types: character

Port number, specified as a scalar integer. For input and output symbols, PortNumber indicates the port index on the block. For parameter symbols, PortNumber indicates the order that the symbol appears in the block parameter mask.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Size of the symbol data specified as a character vector containing a scalar integer. The C Function block supports only scalars and vectors. Matrices and higher-dimension arrays are not supported. You can use a size expression to define the size of an output. Use -1 to inherit size.

Data Types: character

Data type of the symbol, specified as a character vector that evaluates to a numeric data type, or as a Simulink.AliasType object.

Example: mySymbol.DataType = 'int32'

Data Types: char

Scope of the symbol, specified as one of the following values.

  • Input — Input symbol to the C Function block.

  • Output — Output symbol to the C Function block.

  • Parameter — Define a symbol as parameter. The parameter name is defined by the Label property of the symbol.

  • Persistent — Define a symbol as persistent data.

  • You can define a void pointer using the Persistent scope in the C Function block. A void pointer is a pointer that can store any type of data that you create or allocate.

  • Constant — Define a symbol as constant using value-size or numeric expressions.

Data Types: character

Symbol label, specified as a character vector. For symbols with their scope set to Input or Output, this label appears as the port name on the block. For symbols with their scope set to Parameter, this label is the label that appears on the block parameter mask. If the scope is Constant, the label is the constant expression. You cannot define a label for Persistent symbols.

Data Types: character

Introduced in R2020a