Sign in to follow this  
Followers 0
Brad

RSLOGIX 500

16 posts in this topic

I am using a CPW comand to move a word to another file were I need to multiply the word, (or would like to) instead of each bit in the word. can this be done?

Share this post


Link to post
Share on other sites
You can multiply a word by using the MUL function.

Share this post


Link to post
Share on other sites
Do you mean multipy each bit in a word or multilpy each word that you are copying by something(example need to multiply N7:0 through N7:5 by 5)

Share this post


Link to post
Share on other sites
TWControls, Yes that is what I am trying to do. If I just use the MUL it only multiplys one bit!

Share this post


Link to post
Share on other sites
Which one. If what you stated is what you are trying to do, use techjunki's post. If what I stated is what you want to do, how many are you trying to manipulate and do you need to do it in a single scan. The easiest solution depends on these things.

Share this post


Link to post
Share on other sites
TWControls, I am trying to do what you wrote. I have copyed a word N15:0 through N15:6 and move it to N80:0 through N80:6 I need to multiply in one scan.

Share this post


Link to post
Share on other sites
I think you may be a little confused between a word and a bit: A bit is addressed as N80:0/1 -- one bit (bit 1) of a 16 bit Word The word would be N80:0 -- One 16 bit word A group of seven words is what you are working with N80:0 to N80:6. Are you trying to multiply all seven word together or multiply all words by a certain number?? Explain the math you want to perform?? I assume you are using a Micrologix PLC what version is it, as the instructions vary among the different series. Edited by TechJunki

Share this post


Link to post
Share on other sites
You are right I am confused sorry. I am trying to multiply, N80:0 through N80:6 by 2 at one time. using a Micrologix 1500 Edited by Brad

Share this post


Link to post
Share on other sites
Just to clarify this is the math N80:0 x 2 = N80:0 N80:1 x 2 = N80:1 N80:2 x 2 = N80:2 N80:3 x 2 = N80:3 N80:4 x 2 = N80:4 N80:5 x 2 = N80:5 N80:6 x 2 = N80:6 And you would like to do this with only one instruction??

Share this post


Link to post
Share on other sites
For just 7 values I would use the MUL 7 times like Techjunki said. If you have a boat load of them to do might be able to do something similiar to RsLogix 5000s FOR statement but it's a real pain in RsLogix 500.

Share this post


Link to post
Share on other sites
I don't think such an instruction exists. Your only real option (there are other more complex ones) is to have a seperate multiply for each word.

Share this post


Link to post
Share on other sites
I think the simplest way to do this would just be to branch 7 MUL in one rung and multiply them all individually. There are other ways but they are unecessarily complicated for this.

Share this post


Link to post
Share on other sites
Easy is better. Thank-you all for your time and the help!

Share this post


Link to post
Share on other sites
Unfortunately, FAL (which can do math operations on multiple words in a single instruction and scan) is not available on the ML1500. TechJunk has suggested the best option for for the ML1500.

Share this post


Link to post
Share on other sites
Would a rotate instruction be helpfull here? Since multiplication by two just shifts one space left? Usually bit shifts are quicker than multiplies.

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