User manual

82 Publication LOGIX-AP010B-EN-P - May 2010
Chapter 3 Software Conversions Instructions
Multiplication
S5 uses two multiplication instructions depending on whether the operands are 16 bit integers or floating point numbers.
RSLogix 5000 software has one multiplication instruction that can be used regardless of the format of the operands.
Note that you can mix data types, but loss of accuracy and rounding error might occur and the instruction takes more time
to execute. You can check the S:V bit to see whether the rest was truncated.
Function S5 RSLogix 5000
Operand 1 (16 bit) FW18 data_word1
Operand 1 (floating point) FD30
Operand 2 (16 bit) FW20 data_word2
Operand 2 (floating point) FD34
Output (16 bit) FW22 data_word3
Operand (floating point) FD48
S5 Statement List
16 bit fixed point numbers
RSLogix 5000 Structured Text
LFW18
LFW20
xF
LFW18
LFW20
xF
TFW22
data_word3 := data_word1 +
data_word2;
data_word3 := data_word1 *
data_word2;
S5 Statement List
32 bit fixed point numbers
This function can not be performed in S5. Numbers must first be converted
to floating point format.
S5 Statement List
32 bit floating point numbers
LFD30
LFD34
xG
TFD38