Introduction
Some instructions can be executed with several different data types. If you use one of these instructions in the program, you have to specify a valid data type for the instruction at the specific point in the program. For some instructions, you have to select the data types for the inputs and outputs separately.
|
Note The valid data type (BOOL) for the tags on the enable input EN and the enable output ENO is predefined by the system and cannot be changed. |
The valid data types for an instruction are listed in the instruction drop-down list. You specify the data type of the instruction by selecting an entry from the drop-down list. If the data type of an operand differs from the data type of the instruction and cannot be converted implicitly, the operand is displayed in red and a rollout with the corresponding error message appears.
Data type selection of mathematical instructions
Some mathematical instructions provide you with the option of having the data type automatically set corresponding to the data types of the operand. In the drop-down list for data type selection, these instructions have the entry "Auto" in addition to the actual data types. If you select this entry and then allocate the first operand, the data type of the operand is selected as data type for the instruction. The entry in the drop-down list changes to "Auto (<Data type>)", e.g. "Auto (Real)". If you allocate additional operands, the automatically set data type of the instruction is adjusted according to the following criteria:
-
You supply all other operands with tags of the same data type:
The data type of the instruction is not changed.
-
You supply all other operands with tags whose data type is smaller than the data type of the instruction:
The data type of the instruction is not changed. For the operand with the smaller data type, an implicit conversion is conducted if necessary.
-
You supply an additional operand with a tag whose data type is greater than the data type of the instruction:
The data type of the instruction is changed to the larger data type. An implicit conversion is performed, if necessary, for operands that deviate from the newly set data type of the instruction.
Each change in the data type of an operand can result in a change of the data type of the instruction. Other operands may possibly be implicitly converted as a result. Operands for which an implicit conversion is performed are marked with a gray square.
|
Note Please also observe the information on data type conversion for your device and, in particular, the notes on the IEC check. See also: Data type conversion |