Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E0013: a value whose type does not convert implicitly

A value converts to another type implicitly only where no value or precision can be lost (Ed.3 6.6.1.6 and Figure 11): INT to DINT or REAL, BYTE to WORD, TIME to LTIME. Anything else takes a conversion function, which the message names when there is one.

VAR i : INT; d : DINT; r : REAL; END_VAR
d := i;              (* fine: INT widens to DINT *)
i := d;              (* E0013: use DINT_TO_INT *)
r := d;              (* E0013: use DINT_TO_REAL; a DINT can lose digits in a REAL *)

Ed.2 had no implicit conversions; matiec, which follows Ed.2, refuses d := i too.