Sign in to follow this  
Followers 0
turbotater

trlogix 500 addressing question

9 posts in this topic

I have a program with logic in ladders 2 thru 5 . ladder number 3 has only alarm related logic . is there a way to address logic in ladder 2 that says if any rung in ladder 3 is true then that changes a bit that i can use in ladder 2 .

Share this post


Link to post
Share on other sites
There's no simple way to do what you are asking. If LAD3 logic writes (OTE, OTL) to an organized group of bits, then you may be able to compare those bits at the word level for a non zero value. Example, suppose LAD3 is writing to bits B10:0/0 thought B10:3/15 for alarm conditions using OTE instructions. If B10:0 = 0 and B10:1 = 0 and B10:2 =0 and B10:3 = 0 then none of the rungs in LAD3 are true. Conversely, if B10:0 <> 0 or B10:1 <> 0 or B10:2 <> 0 or B10:3 <> 0 then at least one of those rungs is true.

Share this post


Link to post
Share on other sites
In RSLogix 500 all the registers are global - they can be seen by any ladder (just in case that was the source of your question).

Share this post


Link to post
Share on other sites
Write all of your outputs to bits of a Word, N7:0/0 thru N7:0/15 for instance. Then do a compare N7:0 > 0 then output is true It's important to understand that integers are made up of 16 bits. The integer value of 1 looks like this in binary- 0000000000000001 The integer value of 2 looks like this in binary- 0000000000000010 The integer value of 3 looks like this in binary- 0000000000000011 The integer value of 4 looks like this in binary- 0000000000000100 Etc all the way up to 32767 = 0111111111111111 In an Integer, bit 16 is the sign bit and if you use it the value goes negative. That's why I stopped at bit 15. I suppose you could change the compare to NEQ 0 and use bit 16. Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
i rewrote that ladder so that i only have 2 words in it . i made a parallel greater than instruction one for the word in b3:5 and one in b3:6 so if either is greater than zero the rung is true . i am having a problem still though one greater than statement works fine but the other does not . it will display a 1 in the word when i have an alarm but does not make the rung true .

Share this post


Link to post
Share on other sites
Instead of GRT, you should be using NEQ (Not Equal) with Source B of 0, especially if you are using bit 15. Bit 15 is a sign bit and will make the word value less than zero, making your GRT or GEQ false when bit 15 is set no matter what other bits may also be set. Edited by OkiePC

Share this post


Link to post
Share on other sites
[instead of GRT, you should be using NEQ (Not Equal) with Source B of 0, especially if you are using bit 15. Bit 15 is a sign bit and will make the word value less than zero, making your GRT or GEQ false when bit 15 is set no matter what other bits may also be set.

Share this post


Link to post
Share on other sites
Hadn't looked for it in a manual before, but I did find it by searching for "2s complement" in Publication 1747-RM001G-EN-P. Found it on page 650 in my offline copy from November 2008.

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