EasyManua.ls Logo

Omron NJ501-1500

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2-523
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Text String Instructions
2
LEFT and RIGHT
The following example is for when In is ‘ABCDEF’ and L is UINT#3. The value of variable abc will be
‘ABC’.
z 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’.
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 does not end in a NULL character.
In results in a character code error.
The execution result exceeds the size of Out.
Precautions for Correct Use
abc:=LEFT(‘ABCDEF’, UINT#3);
LD ST
abc
‘ABCDEF’
UINT#3
LEFT
EN ENO
In
L
Out=abc
‘ABCDEF’
In
Three characters extracted from the left.
‘ABC’
abc:=RIGHT(‘ABCDEF’, UINT#3);
LD ST
abc
‘ABCDEF’
UINT#3
RIGHT
EN ENO
In
L
‘DEF’
Out=abc
‘ABCDEF’
In
Three characters extracted from the right.

Table of Contents

Related product manuals