beautypg.com

4 reverse polish notation – Micromod Micro-DCI: 53MC5000 Training Manual User Manual

Page 149

background image

Training Manual

F-TRAN Programming Lab

10- 3

The maximum number for each of the program types:

Control F-TRAN programs

20

Display F-TRAN programs

70

User written F-TRAN subroutines

50

10.3.4

Reverse Polish Notation:

The statements in the F-TRAN program are executed in a sequence. The sequence in
which the controller performs a calculation in a statement is dictated by the push-down
stack operation. To accomplish this, the statements in F-TRAN program are written with
a method called Reverse Polish Notation (RPN). This is a special method and is different
from the standard way of executing the calculation in a statement. To understand this,
consider the following examples:

Example 1:
Operands: A and B
Operators: Addition (+)
Standard or Algebraic notation: Calculation: A+B
Reverse Polish Notation: AB +

Example 2:
Operands: A, B and C
Operators: Multiplication (*) and Addition (+)
Standard or Algebraic notation: Calculation: A*(B+C)
Reverse Polish Notation: BC + A *

In Reverse Polish Notation, the operands are written first followed by the operator as in
the example above.