AngryRobot

Use a pointer to look at bit level of Word/Channel?

3 posts in this topic

Is it possible to  use a pointer to look at the bits of a word or channel the same way you would specify an array element?

 

 I'm setting bits of CIO channel 100 (100.00, 100.01, 100.02, etc) and I want to have a contact that looks at 100.XX and goes high or low based on the appropriate coil- and I will change the XX by writing a value do a D area.  CX programmer will take 100.[D100] as a valid contact address, but it won't actually function in the program.

 

What I'm doing is setting bits when certain conditions are made.  Then I'm trying to use a single event display on the HMI to display all of these made conditions, giving the operator a "NEXT" button to display the next condition.  I can make it work exactly how I would like by using an array; but that uses a lot of addresses... and this is going to be a huge program, so I'm legitimately worried about running out of W addresses.  Being able to use the bits inside of a channel gives me sixteen possible bits per address instead of using an entire channel per array element.

IE: W100.00-16 for one "array" instead of W100-116 for an actual array.  The first option only uses one work bit while the second uses 16.

 

 

 

Share this post


Link to post
Share on other sites

I believe what you are looking for is the MLPX(076) and the DMPX(077) instructions.

Share this post


Link to post
Share on other sites

If you are using a CJ2M or greater check out "Indirection". It would look like this 100.00[D100] so if D100=0 then you will be looking at CIO 100.00 if D100=1 then you will be looking at CIO 100.01. If you want a way that works on other PLCs and has even more capacity check out the IR and DR using the MOVR instruction. See the manual I attached.

Using IR and DR for Indirect Addressing JH 071703.pdf

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