Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Automation Systems
  • Programmable Logic Controllers (PLC)

What is #QNAN0 in CX-Programmer?

Written by Daniel Heslewood

Updated at March 18th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

You may or may not have come across an instance in Cx-Programmer, where an instruction shows a result of +1.#QNAN0 as shown below in D200.

This is letting us know that the instruction perceives the result as Not a Number (NaN). Not a Number is not a valid floating point calculation, therefore, normal floating point calculations will not result in NaN.

Floating Point Format

When data is expressed in a floating-point format, the following formula applies to conform to the IEEE745 standard.

 
 

Example

The previous screenshot shows a floating point divide of +50.0/ +2.0. This works mathematically, and you can see when the rung is executed, we get the correct result of +25.0.

The way D200 resulted in NaN, was from a separate MOV instruction that is moving the value #7FC0 into D201.

Following the Floating Point format, this move instruction causes the conditions to be met for NaN. The exponent is 255, and the Mantissa is not equal to 0.

This is essentially a programming error, and can occur from using overlapping memory areas. Avoid overlapping memory areas to prevent this error from occurring. 

Additionally, NaN (not a number) is produced when the result of calculations, such as 0.0/ 0.0, ∞/∞, or ∞–∞, does not correspond to a number or infinity. The exponent will be 255 (28 – 1) and the mantissa will be not 0. Note There are no specifications for the sign of NaN or the value of the mantissa field (other than to be not 0).

 
 

More information can be found in the CP1H/CP1L Programming Manual, Section 3-14.

understanding exploration

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • How to Backup and Restore a Sysmac Project to a SD card
  • Troubleshooting - Monitor Connected/Disconnected Ethernet/IP Units through CX-Programmer

Definition by Author

0
0
Expand