Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 1061

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Text String Processing Instructions
Description
Flags
Precautions
Example
D100
D200
D500
D300
1028
Area
Index Registers
Indirect addressing
using Index Registers
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).
Name
Label
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: D100
D101
D102
D103
D104
S1
S2
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Operation
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 (CP1H only).
OFF in all other cases.
ON when 0000 hex is output to D.
OFF in all other cases.
S2: D200
Three bytes discarded.
S3: D500
From 5th character.
Section 3-31
S3
D
Text string ABCDMHI
D: D300
D301
D302
00
D303

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents