STACKINT (stack integers)
The STACKINT instruction manages a stack of integer values.
Operation details:
- STACKINT includes a rising edge detection for both PUSH and POP commands. The maximum size of the stack is 128. The OFLO value is valid only after a reset (R1 has been set to TRUE at least once and back to FALSE).
- The application defined stack size (N) cannot be less than 1 or greater than 128.
- If N < 1, STACKINT assumes a size of 1.
- If N > 128, STACKINT assumes a size of 128.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
STACKINT

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
PUSH | Input | BOOL |
|
POP | Input | BOOL |
|
R1 | Input | BOOL |
|
IN | Input | DINT | Pushed value. |
N | Input | DINT | Application defined stack size. The maximum size of the stack is 128 |
EMPTY | Output | BOOL |
|
OFLO | Output | BOOL |
|
OUT | Output | DINT | Value at the top of the stack. OUT equals 0 when OFLO is TRUE. |
STACKINT examples
STACKINT function block diagram example

STACKINT ladder diagram example

STACKINT structured text example

(* ST Equivalence: STACKINT1 is an instance of a STACKINT block *) STACKINT1(err_detect, acknowledge, manual_mode, err_code, max_err); appli_alarm := auto_mode AND NOT(STACKINT1.EMPTY); err_alarm := STACKINT1.OFLO; last_error := STACKINT1.OUT;
Results

Provide Feedback