611
Table Data Processing Instructions Section 3-16
Flags
Precautions The stack must be defined in advance with SSET(630).
SINS(641) inserts one word of data into the stack, so there must be at least
one available word at the end of the stack. If the stack is full, an error will
occur and the source data will not be inserted.
If the address indicated by the stack pointer (TB+3 and TB+2) is already
greater than the address of the last word in the stack (TB+1 and TB) when
SINS(641) is executed, a stack overflow error will occur and the source data
will not be inserted.
Examples When CIO 0.00 is ON in the following example, SINS(641) inserts the source
data in D100 at the specified address in the stack starting at D0. In this case,
the stack pointer indicates D7 and the offset value is 3, so the source data is
inserted in D4. The existing data is shifted down one word and the data in D7
is overwritten. At the same time the stack pointer will be incremented from D7
to D8.
Name Label Operation
Error Flag ER ON if the address indicated by the stack pointer (TB+3
and TB+2) is greater than the PLC memory address of
last word in the data region of the stack.
(This is a stack overflow error.)
ON if the offset value specified is greater than the maxi-
mum data region size - 1 (FFFA hex).
OFF in all other cases.
SINS
D0
#0003
D100
0.00
B
C
D
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
A
B
C
D
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D100
A
−3
+1
Last word
in stack
Last word
in stack
Stack
pointer
Stack
pointer
PLC memory address
of last word in the stack
PLC memory address
of last word in the stack
Stack pointer
Stack pointer
PLC memory
address
(Insert)
The stack pointer is incremented
by +1 after the data is inserted.