mr_electrician

Inputs into a DM area

3 posts in this topic

Hello guys.  Been awhile since I have been on here.

I am wanting to integrate a 10 Bit Automation Direct Encoder into some logic that will reside in a CP1H Processor.

I have used the first 10 inputs of the CP1W-40EDR expansion module and need to get those inputs into a word, which then hopefully would be used in the GRY (474) function.

Does anyone have any insight on how I would gather those 10 inputs into a word?

Encoders (automationdirect.com)

Share this post


Link to post
Share on other sites

You'll need to use something other than D registers at first as they don't have bit-access. W or H I would recommend. You could simply map the CIO bit to the W bit in the correct MSB-LSB order.

Share this post


Link to post
Share on other sites
On 10/1/2021 at 8:35 AM, photovoltaic said:

You'll need to use something other than D registers at first as they don't have bit-access. W or H I would recommend. You could simply map the CIO bit to the W bit in the correct MSB-LSB order.

Thanks for the reply.

I ended up mapping my 10 inputs to W15 and then grapping only the first 10 bits of that word.  Works like a charm!!

 

Turnhead.jpg

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