Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
The following example for the STRING_TO_DINT instruction is for when In is '123456789'.
LD
'123456789'
STRING data
In
'123456789'
The valid range of In depends on the data type of Out as shown below:
Data type of Out
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
* 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.
Additional Information
• To convert a text string to a hexadecimal number, use a STRING_TO_** (Text String-to-Bit String
Conversion Group) instruction (page 2-301).
• To convert an integer to a text string, use a **_TO_STRING (Integer-to-Text String Conversion
Group) instruction (page 2-283).
Precautions for Correct Use
• Always use the correct instruction name for the data type of Out.
• If the value of In is '−0', the value of Out is 0.
• 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.
2-300
ST
abc:=STRING_TO_DINT('123456789');
STRING_TO_DINT
EN
ENO
abc
In
DINT data
Out=abc
123456789
Valid range of In (maximum number of bytes)*
4 bytes (three single-byte alphanumeric characters plus the
final NULL character)
6 bytes (five single-byte alphanumeric characters plus the final
NULL character)
11 bytes (10 single-byte alphanumeric characters plus the final
NULL character)
21 bytes (20 single-byte alphanumeric characters plus the final
NULL character)
5 bytes (four single-byte alphanumeric characters plus the final
NULL character)
7 bytes (six single-byte alphanumeric characters plus the final
NULL character)
12 bytes (11 single-byte alphanumeric characters plus the final
NULL character)
21 bytes (20 single-byte alphanumeric characters plus the final
NULL character)

NY-series Instructions Reference Manual (W560)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents