beautypg.com

11 stack operations, 1 load data onto the data stack, 1 load data onto the data stack (ps) ps – HEIDENHAIN TNC 335 Technical Manual User Manual

Page 468

background image


8/95

TNC 360

3 Commands

7-89

3.11 Stack Operations

It should be noted that with Stack operations all read/write operations on the Data Stack take place
according to the LIFO principle (Last In – First Out).

3.11.1 Load Data onto the Data Stack (PS)

PS

Abbreviation for PLC Editor:

PS (PUSH)

Logic

Byte/Word

Double

Constant

Execution time [µs]

4.2

5.4/5.0

5.5

4.2

Number of bytes

24

26

22

24

Logic Execution with the PS Command

Operands: M, I, O, T, C

Operation:
With the PS command, data can be buffered. Thus the addressed operand is loaded onto the Data
Stack. Since the Data Stack is organized as 16 bit, a minimum width of one Word must be used in
writing to it. During this the operand value is copied into bit 7 of the current address in the Data
Stack. The free bits of the reserved memory are undefined or unused. In the event of a Stack
overflow, an error message will be issued.

Memory allocation in the Data Stack:

Bit 15

7

0

x x x x x x x x L x x x x x x x

Word Execution with the PS Command

Operands: B, W, D, K

Operation:
With the PS command, data can be buffered. Thus the addressed memory area (B, W, D, K) is
copied into the current address of the Data Stack. With Word execution, two Words are reserved as
standard on the Data Stack per PS command. The operand is extended in the Stack with sign
justification corresponding to the MSB. In the event of a Stack overflow, an error message will be
issued.

Memory allocation in the Data Stack upon saving of:

Bit 31

15

7

0

Byte

X X X X X X X X X X X X X X X X

X X X X X X X X B B B B B B B B

Word

X X X X X X X X X X X X X X X X

W W W W W W W W W W W W W W W W

Doubleword

D D D D D D D D D D D D D D D D

D D D D D D D D D D D D D D D D

Constant

K K K K K K K K K K K K K K K K

K K K K K K K K K K K K K K K K