Storing, Reading And Deleting Operation Results - Mitsubishi Electric FX2N Beginners Manual

Hide thumbs Also See for FX2N:
Table of Contents

Advertisement

An Introduction to Programming
3.4.9

Storing, reading and deleting operation results

Instruction
MPS
MRD
MPP
The MPS, MRD and MPP instructions are used to store the results of operations and interme-
diate values in a memory called the "stack", and to read and delete the stored results. These
instructions make it possible to program multi-level operations, which makes programs easier
to read and manage.
When you enter programs in Ladder Diagram format these instructions are inserted automati-
cally by the programming software. The MPS, MRD and MPP instructions are only actually
shown when you display your program in Instruction List format, and they must also be entered
manually when you program in this format.
Ladder Diagram
X000
0
MPS
MRD
MPP
To make the advantage of these instructions clearer the example below shows the same pro-
gram sequence programmed without MPS, MRD and MPP:
Ladder Diagram
X000
0
X000
3
X000
6
When you use this approach you must program the devices (X0 in this example) repeatedly.
This results in more programming work, which can make quite a difference in longer programs
and complex circuit constructions.
In the last output instruction you must use MPP instead of MRD to delete the stack. You can use
multiple MPS instructions to create operations with up to 11 levels. For more examples of how
to use the MPS, MRD and MPP instructions see the Programming Manual for the FX Family.
FX Beginners Manual
Function
Memory Point Store, stores the result of
an operation
Memory Read, reads a stored operation
result
Memory POP, reads a stored operation
result and deletes it
X001
Y000
X002
Y001
X003
Y002
X001
Y000
X002
Y001
X003
Y002
The Basic Instruction Set
Symbol
GX Works2 FX
Instruction List
0
LD
X000
1
MPS
2
AND
X001
3
OUT
Y000
4
MRD
5
AND
X002
6
OUT
Y001
7
MPP
8
AND
X003
9
OUT
Y002
Instruction List
0
LD
X000
1
AND
X001
2
OUT
Y000
3
LD
X000
4
AND
X002
5
OUT
Y001
6
LD
X000
7
AND
X003
8
OUT
Y002
3 – 17

Advertisement

Table of Contents
loading

Table of Contents