Floating point in FX1N

DairyBoy

Member
Join Date
Jun 2007
Location
UK
Posts
393
Hi all. Although the FX1N allows floating point instructions, the one that's missing is a means of converting a value to an integer. Has anyone found a workaround for this one? Could I maybe just use the first word of the pair, or is that just plain stupid? Thanks.
 
Floating Point in FX1N

According to the programming manual the FX1N doesn't support floating point functions at all. If you try and use one of the 'E' commands (FNC110 to 129) in GX Dev it doesn't allow you to.
 
DairyBoy said:
Could I maybe just use the first word of the pair...

Even with FP support, using the first word of the pair will not give you a number that remotely resembles what you want. A 32 bit floating point number consists of a sign bit, followed by 8 bits that represent the exponent normalized to 127, and then 23 bits that contain the mantissa of the float.

For example, if we take a look at the value of PI in a single precision float we would see that the high order 16 bit word has the integer 16457 and that the low order word has the integer 4058. Neither one remotely resembles 3.

If all you want to do is a comparrison you can actually get away with a bitwise comparrisson between two sets of words storing the floats, but anyting else is going to be more tricky.
 
Last edited:

Similar Topics

I need to check an axis actual travel position, and to compare it to the master travel position. To do this I have to multiply the axis travel...
Replies
6
Views
2,556
We have AOIs for projects, which handle material dosing (by hand or by pipes and pumps), obviously they have comparison between setpoint and...
Replies
50
Views
14,188
Hi eveyone. I need transfer signal from system 1 to DCS via modbus. System 1 only can send 32 bit floating point. DCS receive 16 bit integer. How...
Replies
20
Views
10,547
Hi, In my ladder logic, I've got a data register D60 whose value is -0.001 (when using monitor mode to see values). D406 is 0.250. But then...
Replies
5
Views
1,299
Hi, can anybody tell that how can we move floating point data from one Regiter to another register in Fatek PLC.?
Replies
0
Views
1,543
Back
Top Bottom