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
STACKINT
STACKINT parameters
Parameter
Parameter Type
Data Type
Description
PUSH
Input
BOOL
  • TRUE: Rising edge detected, on PUSH command. Adds the IN value on the top of the stack.
  • FALSE: Rising edge not detected on PUSH command.
POP
Input
BOOL
  • TRUE: Rising edge detected, on POP command. Deletes the last value pushed to the top of the stack.
  • FALSE: Rising edge not detected on POP command.
R1
Input
BOOL
  • TRUE: Resets the stack to its empty state.
  • FALSE: No reset.
IN
Input
DINT
Pushed value.
N
Input
DINT
Application defined stack size. The maximum size of the stack is 128
EMPTY
Output
BOOL
  • TRUE: The stack is empty.
  • FALSE: The stack contains values.
OFLO
Output
BOOL
  • TRUE: Overflow, the stack is full and R1 has been set to TRUE at least once and back to FALSE.
  • FALSE: The stack size is 128 or less. No overflow.
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 function block diagram example
STACKINT ladder diagram example
STACKINT ladder diagram example
STACKINT structured text 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
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal