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

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

Advertisement

 StackLIFO
The StackLIFO instruction removes the top value from a stack. Value of InOut[Num−1] is assigned to
OutVal. Then, Num is decremented.
The following example is for when Size is UINT#5 and Num is UINT#2.
LD
EN
InOut
abc[1]
OutVal
def
UINT#5
Size
Num
ghi
InOut[0]=abc[1]
InOut[1]=abc[2]
Size=UINT#5
InOut[2]=abc[3]
InOut[3]=abc[4]
InOut[4]=abc[5]
Precautions for Correct Use
• Use the same data type for InOut[] and OutVal. 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 values in InOut[], Num, and OutVal do not change if the value of Size or Num is 0.
• 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 OutVal will not change.
• The values of Num and Size are not 0 and Num is greater than Size.
• The value of Size exceeds the array area of InOut[].
• InOut[] is a STRING array and any of the elements does not end in a NULL character.
• InOut[] is a STRING array and the number of bytes in the elements exceeds the size of OutVal.
Sample Programming
Refer to the sample programming that is provided for the StackPush instruction (page 2-492).

NY-series Instructions Reference Manual (W560)

StackLIFO
ENO
abc[1]
def
ghi
UINT#3
Num = ghi
1234
2345
3456
0
Removed.
0
OutVal = def
ST
StackLIFO(abc[1], def, UINT#5, ghi);
Num = ghi
InOut[0]=abc[1]
InOut[1]=abc[2]
InOut[2]=abc[3]
InOut[3]=abc[4]
InOut[4]=abc[5]
2 Instruction Descriptions
Decremented.
UINT#2
1234
2345
3456
0
0
OutVal = def
INT#3456
2
2-503

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents