EasyManuals Logo

Omron NJ501-1500 User Manual

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
Page #576 background imageLoading...
Page #576 background image
2 Instruction Descriptions
2-528
NJ-series Instructions Reference Manual (W502)
LEN
The LEN instruction finds the number of characters in a text string.
The LEN instruction finds the number of characters in length string In. A NULL character at the end of
In is not counted.
The following example is for when In is ‘ABCDEF’. The value of variable abc will be UINT#6.
• 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.
Instruction Name FB/FUN Graphic expression ST expression
LEN String Length FUN Out:=LEN(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Length
string
Input Text string to find length Depends on data type.
--- ''
Out Find result Output Length detection result 0 to 1985
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK
Out OK
Function
Precautions for Correct Use
(@)LEN
EN ENO
In Out
abc:=LEN(‘ABCDEF’);
LD ST
abc
‘ABCDEF’
LEN
EN ENO
In
UINT#6
Out=abc
‘ABCDEF’In
Number of characters

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ501-1500 and is the answer not in the manual?

Omron NJ501-1500 Specifications

General IconGeneral
BrandOmron
ModelNJ501-1500
CategoryController
LanguageEnglish

Related product manuals