Exchange String: Xchg$(665) - Omron SYSMAC CJ - REFERENCE MANUAL 08-2008 Reference Manual

Programmable controllers
Hide thumbs Also See for SYSMAC CJ - REFERENCE MANUAL 08-2008:
Table of Contents

Advertisement

Text String Processing Instructions
Description
Flags
Precautions
Example

3-33-11 EXCHANGE STRING: XCHG$(665)

Purpose
Ladder Symbol
1242
Within the text string designated by S1, DEL$(658) deletes the number of
characters designated by S2, from the beginning word designated by S3, and
outputs the result to D as text string data (with NUL added at the end).
Note DEL$(658) can be processed in the background. Refer to the SYSMAC CS/
CJ/NSJ Series PLC Programming Manual (W394) for details.
Name
Error Flag
ER
Equals Flag
=
The maximum number of characters for S1 is 4,095 (0FFF hex). If there are
more than that (i.e., if there is no NUL before the 4,096th character), an error
will be generated and the Error Flag will turn ON.
The range for the beginning position designated by S3 is the 1st to the
4,095th character (0001 to 0FFF hex). If the setting is outside of this range, an
error will be generated and the Error Flag will turn ON.
If the number of words specified for S1 exceeds the length of the text string,
the Error Flag will turn ON.
If the number of characters to be deleted extends beyond the end of the S1
text string, all of the characters up to the end will be deleted. If all of the char-
acters from the beginning of S1 to the end are designated to be deleted, then
000 hex will be output to D.
In this example, DEL$(658) is used to read three characters.
Text string ABCDEFGHI
S1:
Replaces a designated text string with another designated text string.
Label
ON if more than 4,095 characters are designated by S1.
ON if more than 4,095 characters (0FFF hex) are desig-
nated by S2.
ON if the S3 data is within the range of 1 to 4,095 (0001 to
0FFF hex).
ON if S3 is greater than S1.
ON if the Communications Port Enabled Flag for the com-
munications port number specified as the Com Port num-
ber for Background Execution is OFF when background
processing is specified.
OFF in all other cases.
ON when 0000 hex is output to D.
OFF in all other cases.
S2: D00200
Three bytes discarded.
S3: D00500
Section 3-33
Operation
Text string ABCDMHI
D:
From 5th character.
00

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cs seriesSysmac one nsj seriesSysmac cj series

Table of Contents