Jump to content

How can I access floating point functions on FX PLCs


Recommended Posts

Posted
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
Posted
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.
Posted (edited)
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
Posted
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.
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...