As @parky notes, we don't really have enough information from OP about their process and/or what they are trying to do. But that's never stopped us before
, so here are some random thoughts ...
The basic problem OP has is that they are using an EQUals comparison for binary floating-point values; that is pointless, perhapse even wrong, unless the program either knows the provenance, or takes strict control, of the sub-1.0 fraction of the values being compared, as e.g. @parky's example does in
Post #4 of this thread (and as mine does, but in the integer domain). Other than such a special case, EQU should only be used for integers (and strings).
Since OP said they want to do an EQUals comparison to two decimal (base 10) places, it seems reasonable that a deadband of 0.005 is "good enough." So why not use a deadband?
We know one of the values is the output an FGEN instruction.
We do not know the origin of the other value; if it is an HMI with two decimal places, then how would OP know if the HMI rounds in the same manner as the PLC? There are only a small number of cases where it matters (see TL;DR below), but that will make debugging anomalies more difficult.
We do not know the character of the FGEN. Perhaps its input argument is a integer, so there are only so many possible discrete input, and therefore output, values. If so, then maybe it would make more sense to run the other floating-point value backwards through an inverse FGEN, converted that inverted FGEN's output to an integer, and compare that integer with the current integer input to the forward FGEN.
'jes sayin'
TL;DR
In IEEE-754 floating-point representation
- There can be no more than four fractions in the range [0:1) for which the value is represented exactly with two decimal places: 0.00; 0.25; 0.50; 0.75.
- There can be no more than four fractions in the range [0:1) for which the third "decimal" place is exactly 5: 0.125; 0.375; 0.625; 0.875.
- For the other up-to-92 fractions of exactly two decimal places, the rule for rounding from 5 is irrelevant.