Convert/Assign

This function block is used to convert signals of one data type to signals of another data type.

It can also be used to assign values of a single data type (if the input and the output have the same data type).

Parameters

The parameter dialog can be used to select the data type and the number of elements for the source and destination.

Signals

Name I/O Type(s) Function
X I BIT, BYTE, WORD, FLOAT, LONG Input signal
Y O BIT, BYTE, WORD, FLOAT, LONG Output signal

Visualization

The color of the selected data types and the number of elements (if greater than one) will be depicted in the symbol.

Comment

The data type of the input can be assigned by creating a new connection.

If the data type is changed by the parameter dialog, all invalid connections will be deleted.

Example

The following example shows how to convert a BIT vector into a single WORD value and back into a BIT vector.