6 Programming
6-38
NJ-series CPU Unit Software User’s Manual (W501)
In order to assign the data in var1 to the data type of var3, the data must first be converted. This type
of conversion is called “data type conversion” or just “type conversion” for short.
When Data Type Conversion Occurs
Converting between data types occurs in the following two cases.
(1) Conversion by User Execution of Data Type Conversion Instructions
(2) Automatic Conversion for Assignments and Instructions
• ST assignments
• Connecting lines in ladder diagrams
var3 := var1;
Assigning a value to a variable of a different data type
var3 is a variable of data type REAL.
var1 is a variable of data type INT.