TConnolly
Lifetime Supporting Member
There are two invalid numbers in the IEEE-754 float format. The first is +/- infinity. The other is +/-NaN. Infinity is indicated when bits 23-30 are all set and no other bit in set. If any other bit is set then NaN is indicated.
The RSLoigx500 ladder logic editor displays NaN under the address in the instruction for both values. However, if you open the data file then you can see 1.#QNAN for an invalid number, and 1.#INF for infinity.
Can you tell us if the invalid value is actually 1.#INF or if it is 1.#QNAN by checking the value shown in the data file. If it is 1.#INF then you may have a divide by zero occurring sometimes during scaling.
You can detect if bits 23-30 of the float are set in your ladder, but due to a RSLogix-500 compiler limitation you can't directly access the bits of a float like you can in Logix5000. To access those bits you need to first copy the float to two consecutive integers. Then do a MEQ on the second integer.
CPW F8:2 N7:100 2
MEQ N7:101 32640 32640 OTE INVALID_NUMBER_FLAG.
You could use that to trap and save the value of I:1.2, and F8:44 and F8:45.
The RSLoigx500 ladder logic editor displays NaN under the address in the instruction for both values. However, if you open the data file then you can see 1.#QNAN for an invalid number, and 1.#INF for infinity.
Can you tell us if the invalid value is actually 1.#INF or if it is 1.#QNAN by checking the value shown in the data file. If it is 1.#INF then you may have a divide by zero occurring sometimes during scaling.
You can detect if bits 23-30 of the float are set in your ladder, but due to a RSLogix-500 compiler limitation you can't directly access the bits of a float like you can in Logix5000. To access those bits you need to first copy the float to two consecutive integers. Then do a MEQ on the second integer.
CPW F8:2 N7:100 2
MEQ N7:101 32640 32640 OTE INVALID_NUMBER_FLAG.
You could use that to trap and save the value of I:1.2, and F8:44 and F8:45.
Last edited: