Download Print this page

Extracting Character String Data From The Right - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Extracting character string data from the right

RIGHT(P)
These instructions extract "n" characters of the character string data stored in the device specified by (s) and later from the
right end (from the end), and store the extracted characters in the device specified by (d) and later.
Ladder diagram
(s)
*1
FBD/LD
EN
ENO
s
d
n
*1 The RIGHT instruction is not supported by the ST language and the FBD/LD language. Use RIGHT of the standard function.
Page 1025 LEFT(_E), RIGHT(_E)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Character string or head device number storing a character string
(d)
Head device number for storing "n" characters extracted from the
right of the device specified by (s)
(n)
Number of characters to be extracted
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
(n)
*1 T, ST, C cannot be used.
Processing details
• These instructions extract "n" characters of the character string data stored in the device specified by (s) and later from the
right end (from the end), and store the extracted characters in the device specified by (d) and later.
b15
(s)
ASCII code for 2nd character
(s)+1
ASCII code for 4th character
ASCII code for "(last character -n+2)"th
character
ASCII code for "(last character -n+4)"th
character
ASCII code for "(last character -1)"th
character
00H
• A character string stored in (s) indicates data stored in devices from the specified device until "00H" is first detected in units
of 1 byte.
8 APPLICATION INSTRUCTION
460
8.8 Character String Operation Instruction
(d)
(n)
Word
T, ST, C, D, W,
U\G
SD, SW, R
*1
*1
b8
b7
ASCII code for 1st character
ASCII code for 3rd character
ASCII code for "(last character -n+1)"th
character
ASCII code for "(last character -n+3)"th
character
ASCII code for "(last character -2)"th
character
ASCII code for the last character
*1
Structured text
ENO:=RIGHTP(EN,s,n,d);
Range
1 to 16383
Double word Indirect
Z
LC
LZ
b0
b15
ASCII code for "(last character -n+2)"th
(d)
ASCII code for "(last character -n+4)"th
(d)+1
ASCII code for "(last character -1)"th
Data type
Data type (label)
Character string
ANYSTRING_SINGLE
Character string
ANYSTRING_SINGLE
16-bit signed binary
ANY16
Bit
BOOL
Bit
BOOL
Constant
specification
K, H
E
b8
b7
ASCII code for "(last character -n+1)"th
character
ASCII code for "(last character -n+3)"th
character
ASCII code for "(last character -2)"th
character
00H
ASCII code for the last character
Others
$
b0
character
character
character

Hide quick links:

Advertisement

loading