DatatypeConversion

This block outputs a signal obtained by converting an input of any data type into another data type. The input and output can be any data type supported by Activate.

    DatatypeConversion

Library

SignalConversions

Description

The DataTypeConversion block outputs a signal obtained by converting an input of any data type into another data type. The input and output can be any data type supported by Activate. In case output is integer, proper actions can be chosen to handle integer overflow and rounding.

The rounding methods "Floor", "Ceil", "Round" call corresponding OML functions, go to OML reference guide for more details.

Rounding method "Int" simply drops the fractional part of double type input.

Parameters

DatatypeConversion_0

NameLabelDescriptionData TypeValid Values

it

Input type

This parameter indicates the input data type. It can be: double, int32, int16, int8, uint32, uint16, uint8, boolean or inherit.

String

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

ot

Output type

This parameter indicates the output data type. It can be: double, int32, int16, int8, uint32, uint16, uint8, boolean or inherit.

String

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

satur

Do on overflow (for integers)

Defines the action in case of an overflow during the operation. The options are: "Nothing" (gives a normal, non saturated result), "Saturate" (gives a saturated result), "Error" (gives an error message). Default is "Nothing".

String

'Nothing'
'Saturate'
'Error'

rmethod

Rounding method (for integers)

String

'Floor'
'Ceil'
'Round'
'Int'

externalActivation

External activation

This parameter defines if the block receives or inherits an external activation. When External Activation is used, an additional activation port is added to the block. Default is OFF.

Number

0
1

Ports

NameTypeDescriptionIO TypeNumber

inherit

explicit

output

1

inherit

explicit

input

1

Port 3

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no