2 Instruction Descriptions
2-466
NJ-series Instructions Reference Manual (W502)
StackPush
The StackPush instruction stores a value at the top of a stack.
The instruction assumes that there are number of stored elements Num elements stored in stack array
InOut[]. Input value In is written to the next element, InOut[Num]. Then, Num is incremented. For num-
ber of stack elements Size, specify the number of elements in InOut[] to use as a stack.
Instruction Name FB/FUN Graphic expression ST expression
StackPush Push onto Stack FUN StackPush(In, InOut, Size,
Num);
Variables
Name Meaning I/O Description Valid range Unit Default
In Input value
Input
Value, structure, or structure
member to place in the
stack
Depends on data type.
---
---
Size Number of
stack ele-
ments
Number of stack array
elements
1
InOut[]
(array)
Stack array
In-out
Array that functions as stack
Depends on data type.
--- ---
Num Number of
stored
elements
Number of elements stored
in stack
Out Return
value
Output Always TRUE TRUE only
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
An enumeration, structure, or structure member can also be specified.
Size OK
InOut[]
(array)
Must be an array with elements that have the same data type as In.
Num OK
Out OK
Function
(@)StackPush
EN ENO
In Out
InOut
Size
Num