The following example is for when In is 'ABCDEF' and L is UINT#3. The value of variable abc will be
'ABC'.
LD
'ABCDEF'
UINT#3
In
'ABCDEF'
Three characters extracted from the left.
'ABC'
Out=abc
RIGHT
Extracts characters from the right (end) of In.
The following example is for when In is 'ABCDEF' and L is UINT#3. The value of variable abc will be
'DEF'.
LD
'ABCDEF'
UINT#3
'ABCDEF'
In
Three characters extracted from the right.
'DEF'
Out=abc
Precautions for Correct Use
• If the value of L is larger than the number of characters in In or it is within the valid range, an error
does not occur and all of the characters in In are copied to Out.
• If the value of L is 0, an error does not occur and only the NULL character is assigned to Out.
• Multi-byte characters are counted as one character each.
• An error occurs in the following cases. ENO will be FALSE, and Out will not change.
• In results in a character code error.
NY-series Instructions Reference Manual (W560)
LEFT
EN
ENO
abc
In
L
RIGHT
EN
ENO
abc
In
L
ST
abc:=LEFT('ABCDEF', UINT#3);
ST
abc:=RIGHT('ABCDEF', UINT#3);
2 Instruction Descriptions
2
2-551