EasyManuals Logo

Omron NJ Series User Manual

Omron NJ Series
668 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 #224 background imageLoading...
Page #224 background image
6-37
6 Programming
NJ-series CPU Unit Software User’s Manual (W501)
6-3 Variables
6
6-3-5 Data Types
Data Processing
The floating-point format expresses only an approximate value. Therefore, there may be a difference
between the floating-point number and its true value. There is also a limited number of effective dig-
its for these values. Therefore, the following actions are taken when you perform calculations with
the floating-point format.
Rounding
If the real value exceeds the effective digits of the mantissa, the value is rounded off according to the
following rules.
The result of the calculation will be the closest value to the value that can be expressed as a float-
ing-point number.
If there are two values that are the closest to the real value (e.g., if the real value is the median
value of two approximate values), the mantissa with a least significant bit value of 0 is selected as
the result of the calculation.
Overflows and Underflows
An overflow occurs when the absolute value of the true value is larger than the maximum value that
can be expressed in the floating-point format. An underflow occurs when the absolute value of the
true value is smaller than the minimum value that can be expressed in the floating-point format.
If an overflow occurs and the true value is positive, the result of the calculation is positive infinity. If
the true value is negative, the result of the calculation is negative infinity.
If an underflow occurs and the true value is positive, the result of the calculation is positive zero. If
the true value is negative, the result of the calculation is negative zero.
Special Value Calculations
Calculations that involve special values (i.e., positive infinity, negative infinity, +0, 0, and nonnu-
meric data) are performed according to the following rules.
Addition of positive and negative infinity results in nonnumeric data.
Subtraction of two infinite values of the same sign results in nonnumeric data.
Multiplication of +0 or 0 with infinity results in nonnumeric data.
Division of +0 by itself, 0 by itself, or infinity by itself results in nonnumeric data.
Addition of positive and negative zero results in positive zero.
Subtracting +0 from itself or 0 from itself results in +0.
Any arithmetic that involves nonnumeric data results in nonnumeric data.
Comparison instructions (such as for the Cmp instruction) treat +0 and 0 as equal.
If you compare nonnumeric data with anything else, the result is always not equal.
Text String Data Format
All STRING variables are terminated with a NULL character (character code BYTE#16#00).
When you use a variable of a different data type, the data type is automatically converted in some
cases. You can also perform the conversion yourself with a data type conversion instruction.
Data Type Conversion
All variables must have data types. Programs must operate properly according to these data types.
For example, the left and right sides of an assignment expression should normally use the same
data type. In some cases, however, it may be necessary to assign data of a different data type to a
variable in order to program something successfully.
Example:
Converting Data Types

Table of Contents

Other manuals for Omron NJ Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NJ Series and is the answer not in the manual?

Omron NJ Series Specifications

General IconGeneral
Program CapacityUp to 128 MB
SD Card SlotYes
Power Supply Voltage24 VDC
Motion ControlYes
USB Ports1
Operating Temperature0°C to 55°C
Communication InterfacesEthernet/IP, EtherCAT, USB
Safety FunctionOptional
Storage Temperature-20°C to 75°C
Communication PortsUSB
DimensionsVaries by model
WeightVaries by model

Related product manuals