EasyManuals Logo

Omron NJ501-1500 User Manual

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #527 background imageLoading...
Page #527 background image
2-479
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Stack and Table Instructions
2
StackIns
The instruction assumes that there are number of stored elements Num elements stored in stack array
InOut[]. Insert value In is inserted at the position specified by the offset Offset (InOut[Offset]). All higher
elements, i.e., InOut[Offset] to InOut[Num−1], are moved to the next higher element in the stack array.
Then, Num is incremented. For number 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#6, Num is UINT#3 and Offset is UINT#1.
• Use the same data type for In and InOut[].
• When an element in the array is passed to InOut[], all elements below the passed element are pro-
cessed.
• The values in InOut[] and Num do not change if the value of Size is 0.
• When In is an enumeration, always use a variable for the input parameter to pass to In. A building
error will occur if a constant is passed.
• 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.
• In and InOut[] contain different data types.
• The value of Size is not 0 and Size is not greater than Num and Num is not greater than or equal
to Offset.
• The value of Size exceeds the array area of InOut[].
• In is STRING data and it 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.
Refer to the sample programming that is provided for the StackPush instruction (page 2-466).
Function
Precautions for Correct Use
Sample Programming
StackIns(INT#2345, abc[1], UINT#6, def, UINT#1);
LD ST
INT#2345
abc[1] abc[1]
UINT#6
def def
UINT#1
StackIns
EN ENO
In
InOut
Size
Num
Offset
Incremented.
Inserted.
1234
3456
4567
0
0
0
InOut[0]=abc[1]
InOut[1]=abc[2]
InOut[2]=abc[3]
InOut[3]=abc[4]
InOut[4]=abc[5]
InOut[5]=abc[6]
InOut[0]=abc[1]
InOut[1]=abc[2]
InOut[2]=abc[3]
InOut[3]=abc[4]
InOut[4]=abc[5]
InOut[5]=abc[6]
Size=UINT#6
Num=def
UINT#3
In
INT#2345
Num=def
UINT#4
1234
2345
3456
4567
0
0
Offset=UINT#1

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ501-1500 and is the answer not in the manual?

Omron NJ501-1500 Specifications

General IconGeneral
BrandOmron
ModelNJ501-1500
CategoryController
LanguageEnglish

Related product manuals