PCustomBlock

The behavior of this block can be user-defined in OML language.

    PCustomBlock

Library

Activate/CustomBlocks

Description

The PCustom block provides a generic interface for specifying its properties and defining its simulation function. The simulation function can be specified by the user using OML code which is stored as a block parameter. The code is interpreted by OML during simulation and it is used to generated C code with the P (inlined) code generator.

Unlike the OMLCustom block, the usage of OML in this block must satisfy some restrictions. For details, see the Extended Definitions for Advanced Users.

Parameters

PCustomBlock_0

NameLabelDescriptionData TypeValid Values

nin

Number of input ports

Number

inports

Input ports parameters

Structure

inports/inrow

Row size

Cell of scalars

inports/incol

Column size

Cell of scalars

inports/it

Type

Cell of strings

'double'
'complex'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'

inports/depu

Feedthrough

Cell of scalars

0
1

inports/name

Name

Cell of strings

nevin

Number of input event ports

Number

nout

Number of output ports

Number

outports

Output port parameters

Structure

outports/outrow

Row size

Cell of scalars

outports/outcol

Column size

Cell of scalars

outports/ot

Type

Cell of strings

'double'
'complex'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'

outports/name

Name

Cell of strings

nevout

Number of output event ports

Number

evoutports

Initial firing values

Structure

evoutports/fir

Firing(<0 for no firing)

Cell of scalars

PCustomBlock_1

NameLabelDescriptionData TypeValid Values

xx

Initial continuous state

Vector

xd

Initial state derivative

Vector

PCustomBlock_2

NameLabelDescriptionData TypeValid Values

nopar

Number of object parameters

Number

oparparams

Object parameters

Structure

oparparams/opartyp

Type

Cell of strings

'double'
'complex'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'

oparparams/oparvalue

Value

oparparams/name

Name

Cell of strings

PCustomBlock_3

NameLabelDescriptionData TypeValid Values

inlined

Inlined OML code

Number

0
1

code

Function code

String

fcn

Function

Structure

fcn/slib

OML file path

Cell of strings

fcn/epoint

OML function name

Cell of strings

impl

Implicit block (function)

Number

0
1

PCustomBlock_4

NameLabelDescriptionData TypeValid Values

nmode

Number of modes

Scalar

nzcr

Number of zero-crossings

Scalar

dept

Activation mode

String

'Always
Active
mode'
'Initially
Active
mode'
'Standard
mode'

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

nout

Port 2

explicit

input

nin

Port 3

activation

input

nevin

Port 4

activation

output

nevout

See Also