Div_by_zero

how to look at specific sections of a register

3 posts in this topic

I posted about a compressor sequencer a few weeks ago.  This is a more specific problem associated with that project.

See below.  I have (3) 16 bit registers assigned to the 3 compressors.  Each register essentially contains 3 pieces of data: 

1.  is the compressor operational or faulted (bit 0)
2.  is the compressor assigned to no pressure point, pressure point 1, 2, or 3 (bits 1, 2, and 3)
3.  is pressure point 1, 2, or 3 actively calling for a compressor (bits 4, 5, and 6)

For compressor #1, for example, to run, one of three states has to be present:

comp_1:0 and comp_1:1 and comp_1_4 are high
comp_1:0 and comp_1:2 and comp_1_5 are high
comp_1:0 and comp_1:3 and comp_1_6 are high

What is the cleanest, most efficient way to do these three checks on the compressor coil rung?

Yes, I could simply use N.O. contacts, but I feel like there's a "cooler" way to do it within the register.

Thanks for any help.


UbM7Sqg.png

Edited by Div_by_zero

Share this post


Link to post
Share on other sites

What is the purpose of a "cooler" way? Are you trying to impress with your skills? Are you trying to make life more difficult for anyone who comes after you and wants to understand the program? I can tell you that when I was working as a technician that I was less than impressed with programmers who wanted to flaunt their knowledge and abilities. Now as an engineer, that has not changed. KISS it. Remember, time is money. And the longer it takes for a third party to figure out your program logic, the longer the system is down. The longer the system is down, the greater the profit loss to  the company.

Share this post


Link to post
Share on other sites

I think that very simple , well defined ladders and rungs using bits with comments would be best for troubleshooting. Don't see a need to over design it?

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