Download User Guide PLC WorkShop for Modicon

Transcript
PLC WorkShop for Modicon
Chapter 11 – Instructions, Enhanced Executive Cartridge Instructions Overview
In this table, FP = Floating Point
Figure 65 – EMTH Function and Code Table
NOTE: For further information, see the Modicon Ladder Logic Block
Library User Guide for detailed explanations of the 38
extended math functions.
Programming Example
The following programming example illustrates the double precision addition EMTH
function (code 1).
When contacts 00021 and 00030 (the top input) are turned ON, the EMTH function is
performed. The contents of holding registers 40106 and 40107 are added to the contents
of 40155 and 40156. If an overflow condition occurs, 40157 is set to 1. The result of the
addition operation is stored in holding registers 40158 and 40159.
The top output, coil 00123, is energized if the operation is successful and the top input is
ON. The middle output, coil 00199, is energized if an error condition exists and the top
input is ON.
In the top node, 40106 and 40107 hold the first operand.
In the middle node:
l
40155 and 40156 hold the second operand.
l
40157 indicates an overflow condition, if set to 1.
l
40158 and 40159 hold the result of the addition operation.
40160 is implied but not actually used for the double precision addition function.
Inthe bottomnode, code number1 isentered, indicatingadoubleprecision additionoperation.
l
- 611 -