Type Conversion

 

 

 

Description

This component is used primarily to a data signal of a particular type to another type. For example, REAL to INTEGER.

 

Most of the type conversions on a typical circuit are from REAL to INTEGER and vice versa.  No accuracy is lost when converting from INTEGER to REAL and hence, PSCAD will automatically do this for you when an INTEGER output (source) is connected to a REAL input (sink).  However, when a REAL output is connected to an INTEGER input, a warning message indicating the possibility of loss of accuracy will be displayed in the Output Window.  The Type Conversion component can be used to ensure an accurate conversion, and to get rid of the warning messages.

 

This component cannot be used to convert arrays.  To convert an array, you must tap individual elements using the Data Signal Array Tap component, perform the conversion and then merge back into an array using the Data Merge component as shown below:

 

 

 

NOTE:  Conversion from REAL to INTEGER can be a NINT operation (which stands for nearest integer), in which case a 1.4 will be converted to 1 and 1.6 will be converted to 2, or it can be an INT operation to always round down, in which case 1.4 and 1.6 will be both be converted to 1.

Input Parameters

Configuration