![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Jun 2006
Location: houston
Posts: 12
|
Rung scanning - fundamental question
Hello everyone,
I have a fundamental question about typical A/B PLC rung scans. Consider the following: A B ---][-------()--- From what I have understood it means the following: IF A = true THEN B = true; ELSE IF A = false THEN B = false; END IF; So that means that each rung actually implies two statements: one when A will be true and the other when A is false. So if B is true above this rung somewhere and when the processor reaches this rung and A is false, IT WILL SET B TO FALSE. Please tell me if I am wrong because this is an important point. I have a background in higer level programming (C, VB.NET, C#) and in those languages, true and false conditions have to be explicitly defined. False conditions are not evaluated so if A is false then nothing will happen to B, if it set to 1 above this rung, B will remain 1. If B is 0, it will still be 0. It seems that this is a very big and fundamental difference between ladder language programming and higher level programming. Please advise. Thanking you all, Bobby1234 |
![]() |
![]() |
#2 |
Member
|
You are correct in your thinking about the single rung you posted. The input bit condition you defined as A controls the on and off state of the output bit condition B. If A is true, then B will be true and if A is false, then B will be false. This is a universal truth and global as far as its effect in the PLC program and memory. PLCs and ladder logic programming are really very simple but powerful nonetheless.
__________________
Thunder is good, thunder is impressive; but it is lightning that does the work! Mark Twain-8/28/1908 |
![]() |
![]() |
#3 |
Lifetime Supporting Member
|
Greetings bobby1234,
my distinguished colleague Randy has already given you the correct answer ... but if you’re looking for more detail, then “Step 2” in this post may help ... and if you’re looking for the “just-turn-on-it-but-don’t-turn-it-off” equivalent in ladder logic, then take a careful look at the Latch instruction used in Rung 0003 of this post ... hope this helps ... and yes, you’re right ... there are some big differences between “higher languages” and “ladder logic” ... and much debate about which is the “better” of the two ... and a slightly more accurate way of phrasing your original “statement” would be: IF A = 1 THEN the distinction between “true” and “1” - and the distinction between “false” and “0” might seem to be minor issues - but they have MAJOR implications in many cases ...
__________________
Last edited by Ron Beaufort; September 9th, 2006 at 03:07 PM. |
![]() |
![]() |
#4 |
Member
|
Although I'm not familiar with A/B processing rules, I've commented here as bobby1234 has posted a step 7 related question.
Note that block containing that rung must be called and there must be no jumps around that rung of logic. If the rung is not executed then the coil would stay at the last state it was processed. Edit: surely the high level statement would be: b:=a; Last edited by SimonGoldsworthy; September 9th, 2006 at 03:07 PM. |
![]() |
![]() |
#5 | |
Lifetime Supporting Member
|
Greetings Simon,
Quote:
by stating it the way I did, I've set the stage for teaching a "latch" rung as: IF A = 1 THEN and also for teaching an "unlatch" rung as IF A = 1 the “A = B” approach, while perfectly valid for the original rung, doesn’t lend itself very well at all to the upcoming lessons of latches and unlatches ... my favorite approach to teaching this stuff is to (hopefully) give one cohesive line of explanation which will work for all (or at least for most) situations ...
__________________
Last edited by Ron Beaufort; September 9th, 2006 at 04:26 PM. |
|
![]() |
![]() |
#6 |
Member
|
bobby1234 - when you posted A/B in the original post, did you mean Allen Bradley or were you simply referring to the A and the B in your ladder logic ?
|
![]() |
![]() |
#7 |
Member
![]() ![]() Join Date: Jun 2006
Location: houston
Posts: 12
|
Thank you for your quick responses. This was one of the questions that was really bothering me. And it is good have gurus here that can show me the way
![]() Simon Goldsworthy, thank you for your post for the Siemens PLC. Currently I am working on Siemens but I am very familiar with A/B PLCs because I wrote HMI software before that interacted with A/B PLCs. I am doing PLC programming nowdays. As such I wanted to clear my basics. I have responded to the your post at the other thread. Once again, thank you randylud, Ron Beaufort and Simon Goldsworthy! I really appreciate that. |
![]() |
![]() |
#8 |
Member
|
Ron, I was swayed by bobby1234's background of C which was making me think of the short but sweet answers!
A latch or Set would be B:=A OR B; An unlatch or Reset would be B:=B AND NOT A; |
![]() |
![]() |
#9 |
Member
![]() ![]() Join Date: Apr 2002
Posts: 3,170
|
In terms of the original question...
"Normal" Ladder Outputs are "LOOKING" for a reason to BE ON! If that reason exists, then the Output will be ON. If not, it will be OFF. What that means is... if you have a rung where any number of branches indicates that the output should be off, and at the same time, you have at least one branch which indicates that the output should be on... the output WILL be ON! In most PLCs the Output is indicated by a positive assertion, symbolically, ---(...). In some PLCs, the Output might also be indicated by a negative assertion, namely, ---( / ). In the case of the negative assertion, the output is LOOKING for a reason to be OFF. In that case, if you have a rung where any number of branches indicates that the output should be on, and at the same time, you have at least one branch which indicates that the output should be off... the output WILL be OFF! |
![]() |
![]() |
#10 |
Member
|
Simon is actually the closest to the truth. If you program a S7 can convert the LAD to STL you will see. The condition is evaluated to a true or false and that result is store in the output(s).
A simple example as bobby1234 presents would not be converted to an if then else. Simon is also right about how a latch and unlatch is done. The computers inside the PLC do not have latch and unlatch instrucitons. They do have AND, OR and NOT instructions. So how does Phil do it on his PLC simulator? |
![]() |
![]() |
#11 |
Member
![]() ![]() Join Date: Jun 2006
Location: Calgary, AB
Posts: 2,531
|
Of course.. and then you have Modicon........
|
![]() |
![]() |
#12 | ||
Member
![]() ![]() Join Date: Oct 2004
Location: Montreal
Posts: 729
|
Quote:
Quote:
.. |
||
![]() |
![]() |
#13 | |
Lifetime Supporting Member
|
if this is the ANSWER, what the heck does the QUESTION look like? ...
Greetings to one and all ...
first a note to my former (and even future) students who might be reading this thread ... Quote:
as I said, that was for my students ... now for the rest of you guys ... stop it ... you’re scaring the children ... this would be a good place for a cute little smiley-face - but somehow I just can’t force myself to use those things ... but, of course, I’m just joking with you ... yes, all of the things that are being said in this thread are basically correct ... and yes, the methods that you’re using to explain the operation of the PLC are fundamentally sound and valid ... but personally, I don’t use these particular methods of explaining the basic operation of the PLC in the technician-level classes that I teach ... remember that most of my students don’t sit in front of a computer and work on PLCs every day ... instead, most of these people have screwdrivers in their back pockets and they only touch the software once or twice a month - and in some cases, only once or twice a year ... what I teach them in a one-week class HAS to be something that they’ll fully understand, and will be able to remember, and will feel CONFIDENT in applying once they’re back on the job ... and what I teach them has to WORK every time they use it ... and we’ve only got one single solitary week to start with XIC, XIO, and OTE - and go all the way through BTR and BTW for analog signals ... “intense” and “demanding” are the most polite ways that most students describe this five-day period - so please don’t get the impression that the material is somehow “watered down” in any way ... in many (most?) cases we go much deeper into the “nuts-and-bolts” than this thread has been going ... consider this: the original rung (in the first post) only had TWO very simple instructions ... what happens when you take a confused beginner and try to teach him/her anything much beyond that basic rung - using some of the “teaching” techniques that have been offered in this thread? ... most of us know the answer to that question from bitter personal experience ... basically you get a student who has “learned” a lot of perfectly valid knowledge - but has absolutely no systematic method of applying that knowledge to the "get-the-machine-fixed" problems that occur out in the field ... I’ve got to send my students back to their bosses with something useful to “hang-their-hats-on” ... so let’s continue the discussion - but rest assured, there are other ways of explaining the same fundamental concepts that we’re dealing with here ... personally I like variety ... but keep in mind that not all students respond to the same material in the same way ... one size does NOT fit all ... and my method of explanation may vary ... PS Edit: just in case I failed to make my primary point ... no, I do NOT use the IF...THEN...ELSE method of explanation in my classes ... but I certainly have no problems with discussing it ... party on ...
__________________
Last edited by Ron Beaufort; September 10th, 2006 at 12:09 PM. |
|
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rslogix5 | plcdb222 | LIVE PLC Questions And Answers | 21 | September 29th, 2006 10:32 AM |
Simple question regarding rung branches | Bobby Stacks | LIVE PLC Questions And Answers | 1 | May 27th, 2005 10:28 AM |
Fundamental question about automation | huynt | LIVE PLC Questions And Answers | 30 | April 2nd, 2005 10:01 PM |
Start of Scan | Beryl | LIVE PLC Questions And Answers | 31 | September 25th, 2003 11:11 AM |
PLC Rung Scanning | ControlLogix | LIVE PLC Questions And Answers | 2 | February 4th, 2003 09:22 AM |