EasyManuals Logo
Home>Omron>Controller>CJ - INSTRUCTIONS

Omron CJ - INSTRUCTIONS User Manual

Omron CJ - INSTRUCTIONS
1308 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 #1136 background imageLoading...
Page #1136 background image
3. Instructions
1098
CS/CJ/NSJ Series Instructions Reference Manual (W474)
z Operand Specifications
Flags
Function
PLC$(661) replaces part of the text string
designated by S1, from the beginning position
designated by S4, with the text string
designated by S2, and outputs the result to D
as text string data (with NUL added at the end).
The number of characters to be replaced is
designated by S3.
• The maximum number of characters in the result is 4,095 (0FFF hex). If the number is greater than
that, only 4,095 characters will be output (with NUL added as the 4,096th).
• From 0 to 4,095 characters (0000 to 0FFF hex) can be replaced. If the number is 0, then the text
string designated by S1 will be output to D just as it is, with no change. If the S2 text string is NUL,
then the operation will be the same as deleting the designated range of text in S1.
• If the S1 text string from beginning to end is replaced by NUL, then two NUL characters (0000 hex)
will be output to D. RPLC$(661) 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
• Set the first destination word D so that it does not overlap with the areas set with the replacement text
string first word S2. RPLC$(654) will not work correctly if these areas overlap.
Example Programming
In this example, RPLC$(654) is used to replace three characters.
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
S1, S2
OK OK OK OK OK OK OK OK OK OK
--- ---
--- OK --- --- --- ---S3, S4 OK OK
D --- ---
Name Label Operation
Error Flag ER • ON if more than 4,095 characters are designated by S1 or S2.
• ON if more than 4,095 characters (0FFF hex) are designated by S3.
• ON if the S4 data is not within the range of 1 to 4,095 (0001 to 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.
Equal Flag = • ON if 0000 (hex) is output to D.
• OFF in all other cases.
S3
S4
S2 K NUL
00 05
00 04
A
C
K
NUL
B
D
I
NUL
S1 DA
C
E
G
I
B
D
F
H
NUL
S3: D300
D2: D200
D4: D500
D100
D200
D300
D500
D400
S1: D100
D101
D
D103
D104
D: D400
D401
D402
D403
Text string ABCDMHI
From 5th byte.
Three characters replaced
Text string ABCDEFGHI
Text string M

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Omron CJ - INSTRUCTIONS Specifications

General IconGeneral
BrandOmron
ModelCJ - INSTRUCTIONS
CategoryController
LanguageEnglish

Related product manuals