Omron CJ - INSTRUCTIONS Reference Manual page 1144

Table of Contents

Advertisement

3. Instructions
Operand Specifications
Word addresses
Area
CIO
WR
HR
S1, S2
S3
OK
OK
OK
D
Flags
Name
Error Flag
Equal Flag
Function
Within the text string designated by S1, INS$(657) inserts the text string designated by S2, after the
beginning word designated by S3, and outputs the result to D as text string data (with NUL added at the
end).
• The maximum number of characters that can be inserted is 4,095 (0FFF hex). If there are more than
that, only 4,095 characters will be output to D (with NUL added as the 4,096th character).
• The 0th to the 4095th character can be specified for the starting position (S3) of the insertion. If the
0th character is specified, the operation is the same as joining S2 and S1.
• If either S1 or S2 is NUL, then the text string designated by the other one of them will be output to D
just as it is. If S1 and S2 are both NUL, then two NUL characters (0000 hex) will be output to D.
• INS$(657) can be processed in the background. Refer to the SYSMAC CS/CJ/NSJ Series PLC
Programming Manual (W394) or the CJ2 CPU Unit Software Operation Manual (W473) for details.
Precaution
• Do not overlap the destination words designated by D with the text string data designated by S2. If
these overlap, the operation will not be executed properly.
Example Programming
In this example, INS$(657) is used to insert two characters.
D100
D200
D400
D300
1106
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
ER
• ON if more than 4,095 characters are designated by S1 or S2.
• ON if S3 exceeds 4,095 (0FFF hex).
• ON if the Communications Port Enabled Flag for the communications port number specified as the
Com Port number for Background Execution is OFF when background processing is specified.
• OFF in all other cases.
=
• ON if 0000 (hex) is output to D.
• OFF in all other cases.
Text string ABCDEFGHI
S1: D100
D101
D102
D103
D104
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
---
---
OK
OK
OK
OK
---
---
Operation
Inserted characters
Text string JK
S2: D200
S3: D400
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
Text string ABCDEFJKGHI
D: D300
D301
D302
D303
D304
D305
TR
bits
---
---

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents