Sign in to follow this  
Followers 0
mulderm

Making a formula in RSLogix5

5 posts in this topic

Hello, I have a formula: y = -0,36x + 610 How must I program this in RSLogix5 without using Floating Points but using integers? Example: x=N7:0 and Y=N7:1 mulderm

Share this post


Link to post
Share on other sites
if x is N7:0 (integer) and y is N7:1 (integer) CPT N7:1 (-0.36 * N7:0) + 610

Share this post


Link to post
Share on other sites
Since you have two varibles and only one equation, which one will you be solving for? The example newpageboba posted is for solving for y, if you need x, it will be different.

Share this post


Link to post
Share on other sites
Or, for a pure integer solution: CPT N7:1 (36 * N7:0 | 100) + 610 OR MUL N7:0 36 N7:100 DIV N7:100 100 N7:100 ADD N7:100 610 N7:1 I'm not sure why you would insist on using integers as the PLC5 supports floats.

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