Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual page 1096

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
Note If the beginning position designated by S3 is beyond the text string designated by S1, an error will be generated and the
Error Flag will turn ON.
Function
Within the text string identified by the first
word designated by S1 until the NUL code (00
hex),
MID$(654)
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).
If the number of characters to be read extends
beyond the end of the text string designated
by S1, the string will be output up to the end.
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.
MID$(654) 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.
Sample program
In this example, MID$(654) is used to read three characters.
D100
D200
D400
D300
1058
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
ER
• ON if more than 4,095 characters are designated by S1.
• ON if more than 4,095 characters (0FFF hex) are designated by S2.
• ON if the S3 data is not 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 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.
reads
the
number
Text string ABCDEFGHIJ
S1: D100
D101
S3:
D
D103
D104
D105
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
---
---
OK
OK
OK
OK
---
---
Operation
of
S2: D200
Three characters read.
S3: D400
From 5th character
(leftmost byte in D00102).
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
Text string EFG
D: D300
TR
bits
---
---

Advertisement

Table of Contents
loading

Table of Contents