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-265
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Data Type Conversion Instructions
2
LrealToFormatString
The LrealToFormatString instruction converts LREAL variable In to a text string. In is expressed as an
alphanumeric text string and output to conversion result Out. A NULL character (16#00) is placed at the
end of Out.
If In contains a negative value, a minus sign () is added to the front of the text string. If In contains a
positive value, a plus sign (+) is not added to the front of the text string.
The format of Out is determined by exponent Exponent, sign column Sign, minimum number of digits
MinLen, and precision DecPlace.
The following examples show the relationships between the values of the input variables and the value
of Out when In is LREAL#1234.56789.
Example 1: Exponent: FALSE
Sign: FALSE
MinLen: USINT#16
DecPlace: USINT#10
Function
Input variable Description
Exponent Exp specifies whether an exponent is given.
TRUE: Exponent
FALSE: No exponent
Sign Sign specifies whether there is a sign column.
TRUE: Sign column
FALSE: No sign column
The sign column is used only for a minus sign (). If the number is positive when the sign
column is specified, the sign column will contain a blank character. If the number is nega-
tive when no sign column is specified, a minus sign () will be added to the front of the inte-
ger part.
However, if the number of digits in the conversion result exceeds the value of MinLen and
the conversion result is positive, the highest digit is placed in the sign column.
MinLen MinLen is the minimum number of total digits for the sign column, integer part, decimal
point, fractional part, and exponent.
If the conversion result has fewer digits than the value of MinLen, the text string will be
right-aligned (except for the sign column) and remaining digits will contain blank charac-
ters. If the number of digits in the conversion result exceeds the value of MinLen, the text
string is left-aligned and the text string for the digits that exceed the value of MinLen is
assigned to Out.
DecPlace DecPlace is the number of digits in the fractional part.
If the number of digits exceeds the value of DecPlace, the extra digits in the fractional por-
tion are rounded off as described below. If the value of DecPlace is 0, the fractional part
and decimal point are not given.
- i i i i . f f f f f f f f e + n n
Minimum number of digits
Sign column
Integer part
Decimal point
Fractional part Exponent

Table of Contents

Related product manuals