electric101

help with NOT and OR instructions

7 posts in this topic

I've been programming PLC's for about 2 months but working with other types of control systems for a few years. I'm currently building a program to control a water storage tank for the farm that will interface with advanced HMI. my issue right now is with my fault light stack and fault logic. im trying to use a NOT instruction so that the green light is always on unless the Red light comes on... so i thought i'd use NOT so that if N7:30 is not true or 1 then the green light is on but if it is true then its off or 0 ...but i keep ending up with -1 or -2 in the interger file. also, my OR logic of the yellow light that should trigger if any of my 4 tank level switches fault only works on one of the rungs... if either of the N22 or 23 come true then N7:31 comes true but it doesnt seem to work the same way on the rung for N7:20 or N7:21 to trigger N7:31... if either of them come true N7:31 doesnt come true. im submitting my logic for your review... thanks so much in advance. WaterSystem.RSS

Share this post


Link to post
Share on other sites
Hi, welcome to the forum. I think you are trying to over complicate things. Why are you using integer files to do bit functions? I have made a mod to your ladder as an example. Steve WATERSYSTEM.RSS

Share this post


Link to post
Share on other sites
As Nephets said, don't use an integer file (Nx:xx) use a bit like B3/0 or B3/1 or directly address the outputs: O:1/2. I think that is what your problem is.

Share this post


Link to post
Share on other sites
I originally used B3:x/x for the fault outputs and OR instructions in the fault logic but they kept flagging errors that i needed to address at the word level... i guess i was going to the bit level. ? i'll have a look at your edits as soon as i get a chance but much thanks for the reply.

Share this post


Link to post
Share on other sites
The XIO instruction is essentially a bitwise NOT. Branches with XIO/XIC instructions are bitwise OR's. You are thinking from a computer programming paradigm, not from discrete logic programming.

Share this post


Link to post
Share on other sites
I originally used the XIO and XIC functions similar to the file nehpets posted.... i was just wanting to learn to use the OR and NOT functions in rslogix... trying to broaded my tool base. the software im used to programming in (which only exists in the company that i currently work for) has OR and NOT functions that work using structured text and thats what i'm used to. thanks again for the reply and the help. Edited by electric101

Share this post


Link to post
Share on other sites
You're getting negative values in N7:3x due to the NOT inverting all sixteen bits - one of which is the sign (bit 15). The logic would work if you just used bit zero - N7:30/0 - after the NOT/OR operations

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