Delta Electronics DVP15MC11T Operation Manual page 265

Table of Contents

Advertisement

DVP15MC11T Operation Manual
Function Explanation
The LEFT/RIGHT instruction extracts a specified-length string from the string In and the extracted
string is output to Out. The LEFT instruction extracts characters from the left of the string In and the
RIGHT instruction extracts characters from the right of the string. The way of extracting characters is
illustrated as below.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software if
the input variables are omitted. But the output variable is allowed to omit.
Programming Example
When the LEFT_In string is 'AaBbCcDd', LEFT_L=2 and LEFT_EN is TRUE, Out1 is 'Aa' as shown
in the following table 1. When the RIGHT_In string is 'AaBbCcDd', RIGHT_L=2 and RIGHT_EN is
TRUE, Out1 is 'Dd' as shown in the following table 2.
The variable table and program 1
LEFT_EN
LEFT_In
LEFT_L
Out1
The variable table and program 2
RIGHT_EN
_8
RIGHT_In
RIGHT_L
Out1
8-194
In =ABCDEFGH
LEFT
ABCDEFGH
E xt ract 4 cha ract ers
f rom t he lef t of th e string
RIGHT
ABCDEFGH
Ext ract 4 ch aract ers
from t he righ t of the st ring
Variable name
L EFT_E N
Variable name
RIG HT_ EN
L=4
LEFT
Out : ABCD
RIGHT
Out : EFGH
Data type
BOOL
STRING
UINT
STRING
1
L EFT
EN
ENO
LEFT_ In
In
Ou t
O ut1
LEFT_L
L
Data type
BOOL
STRING
UINT
STRING
1
RIG HT
E N
ENO
RI GHT_In
In
O ut
Out 1
RIGHT_L
L
Current value
TRUE
'AaBbCcDd'
2
'Aa'
Current value
TRUE
'AaBbCcDd'
2
'Dd'

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents