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 Twin Activate.
Library
Activate/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 Twin 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
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
it | Input type | This parameter indicates the input data type. It can be: double, int64, int32, int16, int8, uint64, uint32, uint16, uint8, boolean or inherit. | String | 'double' |
ot | Output type | This parameter indicates the output data type. It can be: double, int64, int32, int16, int8, uint64, uint32, uint16, uint8, boolean or inherit. | String | 'double' |
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' |
rmethod | Rounding method (for integers) | String | 'Floor' | |
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 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
inherit | explicit | output | 1 | |
inherit | explicit | input | 1 | |
Port 3 | activation | input | externalActivation |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | |
direct-feedthrough | yes | |
zero-crossing | no | |
mode | no | |
continuous-time state | no | |
discrete-time state | no |