Download Print this page

Chapter 25 Character String Functions - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

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

Advertisement

25
CHARACTER STRING FUNCTIONS
25.1
Character String Length Detection
LEN(_E)
These functions detect the length of an input character string and output the result.
Ladder diagram, FBD/LD
[Without EN/ENO]
s
d
Setting data
■Descriptions, types, and data types
Argument
EN
s(IN)
ENO
d(LEN(_E))
Processing details
■Operation processing
• These functions detect the length of a character string input to (s) and output the result from (d).
High-order byte
+0
ASCII code for 2nd character
+1
ASCII code for 4th character
+2
ASCII code for 6th character
00H (Indicates the end of the character string.)
+n
• A value input to (s) is the STRING type data value and within the range from 0 to 255 byte(s).
■Operation result
1.
Function without EN/ENO
The operation processing is executed. The operation output value is output from (d).
2.
Function with EN/ENO
The following table lists the execution conditions and operation results.
Execution condition
EN
TRUE (Executes operation)
FALSE (Stops operation)
*1 When FALSE is output from ENO, data output from (d) is undefined. In that case, modify a program so that the data output from (d) is
not used.
Operation error
There is no operation error.
25 CHARACTER STRING FUNCTIONS
1024
25.1 Character String Length Detection
[With EN/ENO]
EN
ENO
s
d
Description
Execution condition (TRUE: Execution, FALSE: Stop)
Input
Output status (TRUE: Normal, FALSE: Abnormal)
Output
Operation result
ENO
TRUE
*1
FALSE
Structured text
[Without EN/ENO]
d:=LEN(s);
[With EN/ENO]
d:=LEN _E(EN,ENO,s);
Type
Input variable
Input variable
Output variable
Output variable
Low-order byte
ASCII code for 1st character
ASCII code for 3rd character
ASCII code for 5th character
ASCII code for (n)th character
(d)
Operation output value
Indefinite value
Data type
BOOL
STRING(255)
BOOL
INT
Character string length
INT

Hide quick links:

Advertisement

loading