![background image](http://html1.mh-extra.com/html/omron/sysmac-cs1d-cpu/sysmac-cs1d-cpu_reference-manual_7422681270.webp)
1231
Text String Processing Instructions
Section 3-33
Description
RGHT$(653) reads the number of characters designated by S2, from the left
(the beginning) of the first word of the text string designated by S1 until the
NUL code (00 hex), and outputs the result to D (with NUL added at the end).
If the number of characters to be read exceeds the number of characters des-
ignated by S1, the entire S1 text string will be output.
If 0 (0000 hex) is designated as the number of characters to be read, the two
NUL characters (0000 hex) will be output to D.
Note
RGHT$(653) can be processed in the background. Refer to the
SYSMAC CS/
CJ/NSJ Series PLC Programming Manual
(W394) for details.
Flags
Precautions
The maximum number of characters to be read that can be designated by S2
is 4,095 (0FFF hex). If more than that are designated, an error will be gener-
ated and the Error Flag will turn ON.
If 0000 (hex) is output to D, the Equals Flag will turn ON.
Example
In this example, RGHT$(653) is used to read four characters.
3-33-6 GET STRING MIDDLE: MID$(654)
Purpose
Reads a designated number of characters from any position in the middle of a
text string.
Ladder Symbol
Name
Label
Operation
Error Flag
ER
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 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.
Equals Flag
=
ON if 0000 (hex) is output to D.
OFF in all other cases.
S1:
D:
S2: D00200
Text string CDEF
Four characters
(bytes) read.
Text string ABCDEF
MID$(654)
S1
S2
S3
D
S1
: Text string first word
S2
: Number of characters
S3
: Beginning position
D
: First destination word
Содержание SYSMAC CS1D-CPU**
Страница 3: ...iv...
Страница 29: ...xxx...
Страница 185: ...146 List of Instructions by Function Code Section 2 4...
Страница 193: ...154 3 35 4 MOVE BIT MOVBC 568 1274 3 35 5 BIT COUNTER BCNTC 621 1276 3 35 6 GET VARIABLE ID GETID 286 1278...
Страница 1389: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2...
Страница 1390: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits...
Страница 1391: ...1352 ASCII Code Table Appendix A...