Sign in to follow this  
Followers 0
Govind Lathkar

FX1N- 2 ^ 1.23 calculation

17 posts in this topic

Dear All I am using FX1N PLC Here D10 and D12 are real value. here I want to calculate 5.123 rase to the power (6.456 ) e.g 2.12 ^ 2.34 = 5.80264384 thanking you Regards Govind L. Lathkar

Share this post


Link to post
Share on other sites
FX1N does not support real numbers. Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
You need an FX2N, FX2NC, FX3U, FX3UC, FX3G to do real numbers.

Share this post


Link to post
Share on other sites
thanks for replay I know fx1n dosen not support real no. actually I want to know any method to calculate above logic, small program which can solve above regards Govind L. Lathkar

Share this post


Link to post
Share on other sites
I would say that what you require is not possible. (I think it would require lograrithms and real number multiplication at the very least. Is there room enough for log tables in the D registers? ) Edited by Veganic

Share this post


Link to post
Share on other sites
i would say there are not too many impossible things and this one may be doable (as part of proof of concept) but i doubt this would be practical. on platforms that do not support floating points (like most of the microcontrollers for example) this is often done with fixed points (not floating, fixed points are easier to implement).

Share this post


Link to post
Share on other sites
I thought long and hard before putting 'not possible.' 'Not practical' gave too much hope. Govind Lathkar also asked for a short program. I've be interested to see an example, practical or not.

Share this post


Link to post
Share on other sites
b^x=(e^ln(b))^x=e^(x*ln(b)) That is, a PLC featuring natural exponent and natural logarithm instructions, will calculate the subject very simply and in single pass. FX3U will do the job, as well as OMRON CP1H/CP1L for instance (talking of the same class PLC). Be aware, that natural logarithm is defined only for positive non-zero numbers (which is the b limitation for the formula above). Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
Exactly. And the major problem is the lack of real numbers. On FX2N it is solvable even in lack of exponent and logarithm instructions, as these functions may be calculated as series. Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
Here's a PLC example. It will work with all Q series and FX3U with maybe a small modification. I'm also sure Ive done this type of conversion working on Pirani Vacuum gauge equations wih the FX2N, but I'll need to dig up the code from those projects. For those working with GX-IEC, you simply create a Structured Text Function and write in the function block.. result := var1 ** var2

Share this post


Link to post
Share on other sites
Your example includes floating point data (such as EMOV) which he does not have available in the FX1N.

Share this post


Link to post
Share on other sites
Thank for replay yes FX1n dose not support real number. in fx1n no log or antilog fonction present, no exponential function present.. I want any idea to solve it. regards govind l lathkar

Share this post


Link to post
Share on other sites
Upgrade to FX3U.

Share this post


Link to post
Share on other sites
sorry custmor will not allow. I thnik this forum is for such tricky solution

Share this post


Link to post
Share on other sites
Hi Govind, As far as I can see, every solution (practical or not) has been mentioned. I would summarize it as: - change hardware (upgrade to CPU that does support this) - add hardware (leave existing CPU, add another PLC, MCU or PC for example and let it do the calculation) - develop code (port existing code from embeded systems etc., best bet to ask questions on embeded or math forums) - let customer find someone else who will do it without hardware change (hut off) Google may offer some insight ("log and exp without floating point" etc.) but even if/when you find some code sample, it will not be for PLC, you will need to port it. Good luck (and please let me know how it turns out....)

Share this post


Link to post
Share on other sites
Just out of curiosity, what is a real life application requiring such calculations on this class PLC?

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