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-273
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Data Type Conversion Instructions
2
STRING_TO_** (Text String-to-Bit String Conversion Group)
The following example for the STRING_TO_BYTE instruction is for when In is ‘ AB’. Any blank charac-
ters at the beginning are ignored.
The valid range of In depends on the data type of Out as shown below:
* Any blank characters (‘ ’) at the beginning of the text string, any zeros at the beginning of the text string, and any
underbars (‘_’) in the text string are not included in the number of bytes.
To treat a signed number as a text string, use a STRING_TO_** (Text String-to-Integer Conversion
Group) instruction (page 2-270).
To convert a bit string to a text string, use a **_TO_STRING (Bit String-to-Text String Conversion
Group) instruction (page 2-255).
Always use the correct instruction name for the data type of Out.
An error occurs in the following cases. ENO will be FALSE, and Out will not change.
The text string in In does not express a number.
The conversion result exceeds the valid range of the data type of Out.
The text string in In does not end in a NULL character.
Data type of Out Valid range of In (maximum number of bytes)*
BYTE 3 bytes (two single-byte alphanumeric characters plus the
final NULL character)
WORD 5 bytes (four single-byte alphanumeric characters plus the
final NULL character)
DWORD 9 bytes (eight single-byte alphanumeric characters plus
the final NULL character)
LWORD 17 bytes (16 single-byte alphanumeric characters plus the
final NULL character)
Additional Information
Precautions for Correct Use
abc:=STRING_TO_BYTE(’ AB’);
LD ST
abc
‘ AB’
STRING_TO_BYTE
EN ENO
In
STRING data BTYE data
‘ AB’
16#AB
In Out=abc

Table of Contents

Related product manuals