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,909
Howdy everyone, My company has a few machines running on SLC500 based PLC, and everytime it makes a part we count up on the counter which gets...
Replies
10
Views
327
Hello All! I am writing today because I cannot figure this out for the life of me. Another site I am affiliated with keeps having their slc 5/03s...
Replies
31
Views
714
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
111
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
125
Back
Top Bottom