.

Conversions

Integer to Double, Double to Integer, Float to Double, Double to Float

Overview

Overview

The Conversion Blocks, Integer to Double, Double to Integer, Float to Double, and Double to Float perform the corresponding data conversions. 

The configuration values  for this block are as follows:

 

Subsample Code

A code which determines the schedule for updating this block (every sample, even samples only, etc.) See Subsampling.

User Data 0 Application-specific data. See User Data Storage.
User Data 1 Application-specific data. See User Data Storage.

 

Matlab/Simulink

Simulink Interface

Conversions Simulink Blocks

Double to Integer: Input is double precision (64-bit) floating point value, output is 32-bit integer value.

Double to Float: Input is double precision (64-bit) floating point value, output is single precision (32-bit) floating point value.

Integer to Double: Input is 32-bit integer value, output is double precision (64-bit) floating point value.

Float to Double: Input is single precision (32-bit) floating point value, output is double precision (64-bit) floating point value.

The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details.

The block's update schedule is determined by the Subsample Code (See Subsampling). The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:  

Parameters Dialog Box

C++ API

DTOIBlock, DTOFBlock, ITODBlock, FTODBlock

Declaration

Public Method

 

DTOIBlock&   DTOI();

DTOFBlock&   DTOF();

ITODBlock&   ITOD();
FTODBlock&   FTOD ();
Required Header: mechaware.h

Description

The Conversion Blocks, Integer to Double, Double to Integer, Float to Double, and Double to Float perform the corresponding data conversions.

Double to Integer: Input is double precision (64-bit) floating point value, output is 32-bit integer value.

Double to Float: Input is double precision (64-bit) floating point value, output is single precision (32-bit) floating point value.

Integer to Double: Input is 32-bit integer value, output is double precision (64-bit) floating point value.

Float to Double: Input is single precision (32-bit) floating point value, output is double precision (64-bit) floating point value.

These blocks have no configurable parameters.

Methods

Block Methods

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2012 Motion Engineering