Sign in to follow this  
Followers 0
DaMage

How can I access floating point functions on FX PLCs

7 posts in this topic

Hi All, I've just got a n FX1S and I had to recognize it doesn't support floatin-gpoint operations. Regarding to the manual the FX2N or FX2NC does. I made a try and started a new project in GX Developer 8.5 but and selected FX2N© PCU. I experienced the floating-point functions EADD ESUB EMUL... etc stlill be not in the selectable functions. So how can I access those functions and which FX really support it.? I have another question: I multiplied two 16bit integer a negative and a positive numbers (e.g. -140 * 110) the result is 32bit long but positive. How can I command the multiplication correctly to keep the sign without long annoying coding ? Thanks for your help in advance

Share this post


Link to post
Share on other sites
1) The FX1S doesn't support arithmetic with REAL. You can operate only with INTEGERS. 2) Something wrong, because a multiplication of 16-bit negative integer with 16-bit positive integer gives 32-bit negative integer. Exactly.

Share this post


Link to post
Share on other sites
Thanks the info. 1. As I wrote I recognized FX1S doesn't work. My question is how can I access the instructions If I select FX2N PCU? 2. My exaple [MUL K-100 K115 D10] the monitor shows result in D10 = 54036 this confused me. I made an additional line after the multiplication [MOV D10 D20] now the monitor shows the right value -11500. I think it must be a bug in the monitor. 3. The manual said the result of a MUL size is 32bit how can check if the result exceeds the 16bit. After [MUL K-1000 K115 D10] the monitor shows wrong resut too but in this case against the previous I cant acces the exact value. where can I access the complete value?. Edited by DaMage

Share this post


Link to post
Share on other sites
It's not a bug in the monitor. Just the monitor show a DWORD representation of the result, stored in the tandem of D10 & D11.
1 person likes this

Share this post


Link to post
Share on other sites
Inntele, Thanx for the correct answers. How can I give fraction constant to float instruction ?

Share this post


Link to post
Share on other sites
By floating point division of integers: DEDIV K2 K3 D0

Share this post


Link to post
Share on other sites
Thanx for the answers. I still have problem with accessing higher 16 bit of the result of a [MUL K1000 K115]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0