Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

Function
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.
The following example is for when Size is UINT#5 and Num is UINT#2.
LD
INT#3456
abc[1]
UINT#5
def
InOut[0]=abc[1]
InOut[1]=abc[2]
Size=UINT#5
InOut[2]=abc[3]
InOut[3]=abc[4]
InOut[4]=abc[5]
Additional Information
Use the StackFIFO or StackLIFO instruction (page 2-501) to remove the bottom or top value that was
stored in the stack.
Precautions for Correct Use
• Use the same data type for In and the elements of InOut[]. If they are different, a building error will
occur.
• When an element in the array is passed to InOut[], all elements below the passed element are pro-
cessed.
• The value of InOut[] or Num does not change if the value of Size is 0.
• Always use a variable for the input parameter to pass to In. A building error will occur if a constant is
passed.
• If In is an enumeration, you cannot directly pass an enumerator to it. A building error will occur if an
enumerator is passed to it directly.
• Return value Out is not used when the instruction is used in ST.
• An error occurs in the following cases. ENO will be FALSE, and InOut[] will not change.
• The value of Size is not 0 and Num is greater than or equal to Size.
• The value of Size exceeds the array area of InOut[].
• In and InOut[] are STRING data and the number of bytes in In exceeds the size of InOut[].

NY-series Instructions Reference Manual (W560)

ST
StackPush(INT#3456, abc[1], UINT#5, def);
StackPush
EN
ENO
In
InOut
abc[1]
Size
Num
def
Num=def UINT#2
1234
2345
0 :
0
Stored
0
In INT#3456
2 Instruction Descriptions
Incremented
Num=def UINT#3
InOut[0]=abc[1]
1234
InOut[1]=abc[2]
2345
InOut[2]=abc[3]
3456
InOut[3]=abc[4]
0
InOut[4]=abc[5]
0
2
2-493

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents