Can a SLC 5/04 GEQ cmd compare floats or do they have to be integers? EOM

Floats are not Real

There's one more thing to consider - how floating points are stored in the PLC.

The following is from Rockwell Knowledgebase article A8262:
[There is a] limitation of the IEEE floating point format used by Logix, PLC-5 and SLC-500 processors. The data are stored as a single precision floating point number consisting of 32 bits: 23 bits for the fraction, 8 bits for the exponent and 1 bit for the sign.

The fractional number displayed is the sum of (1/2)**N, where N is the 23 bit fraction part. If the number can be EXACTLY represented as a sum of fractions such as ½, ¼, 1/8, 1/16, etc., then it will display "correctly". Otherwise, the inaccuracy is about 1x10e-007.

RSLogix 5000 displays the exact value contained in the processor, rather than rounding the data, thus, for 7.52, you might see 7.5199997, as an example.

Keep in mind that this error can also occur when doing a calculation, depending on the numbers used. Thus, the calculation of an internal 7.52 (which is actually 7.5199997) times 2 should come up with 14.04, it could conceivably come up with 14.03999997. But if you were to type 14.04, that might be stored as 14.04, and thus your GEQ (particularly the EQ part) will determine that the typed number is 'good', but that the calculation is 'bad'.

I don't know that this is what's happening, but it's a straw to grasp at. I do remember in my early years being bitten when trying to compare a float using an EQU, and discovering that it was quite exactly equal - just really, really close.
 

Similar Topics

I have 4 outputs which cycle off-back on, one at a time if more than 1 output shuts off I need to set an alarm I`m wanting to use the compute...
Replies
3
Views
1,893
I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
95
Hello all. I have a few SLCs in my plant and of late we've seen a weird issue: The system will be running normally and then randomly the outputs...
Replies
2
Views
103
I am working on setting up a Prosoft Datalogger model PLX51-DLplus-232. This unit will be collecting data from a SLC 5/05 on the DB9 port set to...
Replies
3
Views
104
I have a redundant ControlLogix being set up. This program reads a value from a remote site which happens to be SLC PLC. Rockwell mentions SLC...
Replies
2
Views
96
Back
Top Bottom