Pawks666 Posted January 20, 2016 Report Share Posted January 20, 2016 Hello, Is there an option to use exponentiation function in u90ladder? I see that there is a function of square root, but no exponentiation. Thank you, Best regards, Pawks Link to comment Share on other sites More sharing options...
AlexUT Posted January 20, 2016 Report Share Posted January 20, 2016 Hi Pawks, What model of PLC do you use? What is a version number of U90Ladder? Link to comment Share on other sites More sharing options...
Pawks666 Posted January 20, 2016 Author Report Share Posted January 20, 2016 Hi, U90Ladder version: 6.4.9 (DB109) PLC: Jazz JZ20-R31 Link to comment Share on other sites More sharing options...
AlexUT Posted January 20, 2016 Report Share Posted January 20, 2016 Hi Pawks, Jazz 2 (JZ20) does not support exponential function. Jazz 2 have limited Long support and no float point support. What kind of calculations do you need? What is a formula? What is an input and output numbers range? You can look at Internet, how to realize approximate exponent calculation in integer numbers. If you are in need of math functions, you can use Samba PLC, which have support of Exp function and Floating Point support. BR Link to comment Share on other sites More sharing options...
Pawks666 Posted January 21, 2016 Author Report Share Posted January 21, 2016 Hi, Thank you for answer. I only needed 2^x, where x is an integer up to around 10 max, so the results are 2,4,8,....,1024. If anyone else would like to know i used loop function. every loop i multiply number by 2 and decrease x by 1 until x equals zero. Not a big problem, i just thought that such function already existed. Thanks again, Regards, Pawks Link to comment Share on other sites More sharing options...
s.pratt Posted January 21, 2016 Report Share Posted January 21, 2016 Hello Pawks, have you thought about using the shift register special function? When shifting an MI to the right, you are multiplying the number by 2 each shift. So for 2^5, you could use the shift register function and shift the bits by 5 to the right. The only issue is when the number becomes very large - if you shift the bits in the MI too far, the bits at the end will drop resulting in an incorrect number. Shift function: SI 87 = number to be shifted SI88 = number of bits to shift Set SB 87 to shift to the left Set SB 88 to shift to the right Hope this helps. Link to comment Share on other sites More sharing options...
Pawks666 Posted January 22, 2016 Author Report Share Posted January 22, 2016 Hi, well, i was thinking about that function, but something in my head said to me that it wouldn't work...i guess my head at that point was too tired to think properly... Anyway, you're right, shift is exactly what i need, thank you... Regards, Pawks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now