RSlogix - Simple 2 level Elevator with Subroutine

Thank you Lancie, you worked a lot! I can only get back to you on that after the weekend. Have a great weekend... try to sleep :)

Much appreciated,
Cheers.
 
Thanks. Most likely I made a few errors in translating the LogixPro version over to RSLogix. But the basic structure should be sound, with a little tweaking.
 
There is an error in Sub 4, Rung 0001. IP2 should be IP1.

I looked for ways to compact the new program. Subs 7 and 9 could easily be combined.

Combinining any of the other subroutines seems futile, because then you would need a flag or step instruction at the beginning of every rung, to prevent the execution of that logic except at the right times.
 
Last edited:
Big important question: Do you HAVE to use the MicroLogix PLC memory addresses in your assignment? If not, we could use the Logix Elevator Simulator addresses, and use the actual LogixPro Elevator simulator to test your program. That would make testing a lot easier.

No we do not have to use the MicroLogix PLC memory addresses in my assignment. I could have used any software to solve the problems.
 
OK I have reviewed the program rung by rung. I understand the different security check you use for tracking the car and avoid unwanted motor actions. It's very very clever.

I also tested it in LogixPro. Worked as expected.

I will go further in depth rung by rung for my final paper. I'll send you a copy as promised.

There is an error in Sub 4, Rung 0001. IP2 should be IP1.
I corrected it.

Thank you for your valuable work and explanations!

Much appreciated,
Cheers.

Elevator4_0002.JPG
 
Oh I almost forgot, very clever way to use multiplexing for the request button. This is an eye-opener, I won't forget this one...

Cheers.
 
Oh I almost forgot, very clever way to use multiplexing for the request button. This is an eye-opener, I won't forget this one...

That is a fairly common method in PLC programs. Sometimes you have to use the same input to perform many different functions, but at different steps or at differnt times. You use step relays or flags to determine what the multi-plexed input means at each step in the process.

One more thing about using the same buttons for two different functions: because you had to use the IP1 and IP2 inputs, then your call requests are limited to being activated when the elevator is at one level or the other, but not in-between floors.

If you want to allow activation between floors, then you simply remove the IP1 and IP2 from rungs 0000 to 0003, and allow the simulated encoder comparison instructions to determine at what point IP3 switches from calling for Level 1 to calling for Level 2, or vice-versa. For example, in rungs 0000, you could remove the XIO IP2, and reduce the GRT Source B from 38 all the way down to halfway between floors, or 20. Then when the elevator is leaving Level 1, and the "encoder" becomes 20 or greater, then the call button can again call for floor 1 even as the elevator continues on its way to complete the original call to Level 2. For Rung 0001, the LES Source B should also be changed to "20", so that as the elevator leaves floor 2 on its way to 1, you could use IP3 to insert a call back to 2 (after it finishes going to 1).

For a typical elevator with buttons in the car and on each floor, the above problem does not occur. Each button reserves a call to its floor, and stays sealed in until that request has been met.
 
Last edited:
You use step relays or flags to determine what the multi-plexed input means at each step in the process.

Thank you . I needed that clarification. I was a bit confused with the term "step relay" but now I understand it in context. It's quite an important key to PLC logic. Very valuable information... thanks again.

If you want to allow activation between floors, then you simply remove the IP1 and IP2 from rungs 0000 to 0003, and allow the simulated encoder comparison instructions to determine at what point IP3 switches from calling for Level 1 to calling for Level 2, or vice-versa. For example, in rungs 0000, you could remove the XIO IP2, and reduce the GRT Source B from 38 all the way down to halfway between floors, or 20. Then when the elevator is leaving Level 1, and the "encoder" becomes 20 or greater, then the call button can again call for floor 1 even as the elevator continues on its way to complete the original call to Level 2. For Rung 0001, the LES Source B should also be changed to "20", so that as the elevator leaves floor 2 on its way to 1, you could use IP3 to insert a call back to 2 (after it finishes going to 1).

For a typical elevator with buttons in the car and on each floor, the above problem does not occur. Each button reserves a call to its floor, and stays sealed in until that request has been met.

I understand. Yup this problem is with an elevator that doesn't have buttons included for each floors on the car operator panel. I understand why an encoder could be considered if the end user would complaint about unwanted behavior resulting from the elevator's logic.

Much appreciated,
Cheers
 
Hi Lancie, could you explain me a little bit more how the LOWEST FLOOR REQUESTED "MOV" logic components works with N7:0 on rung #0005 to 0006 on subroutine 4 ? Just to double check things in case I missed out anything...

Cheers.

Elevator4_0005-6.jpg
 
For a 2-level elevator, could you delete the rungs that determine the lowest floor requested? Test it for yourself. Delete rungs 5, 6, and 7 in Sub 4, then run it to see if it will work. For only 2 floors, you still need a way to determine the direction of travel, and that Lowest Floor Requested routine is part of determing whether the elevator needs to go up or go down.

For the 4-floor elevator, the LogixPro Elevator Exercise 4 specifications were:
Once moving towards the farthest requested floor, the elevator should not stop at an intermediate floor if the request at that floor is for the opposite direction; unless this is the farthest request. Otherwise the floor should be bypassed and serviced when the elevator later approaches the floor from the opposite direction of travel.
Suppose the elevator is on the 4th floor, and someone on the 2nd pressed the DOWN button on the wall. Before the elevator moves, someone rushes into the car and presses "2". Now the car starts and moves down past the 3rd floor, while at the same time a new person back on the 4th floor presses the DOWN button. Where will the elevator go? Should it then reverse and go back to the 4th to pick up the late passenger, or continue in the same direction until it reaches the lowest floor request (1) before reversing and going back up all the way to pick up the guy on 4?

The rungs In Sub 4 that determine the Lowest Floor Requested (while going DOWN) help to prevent the elevator reversing back and forth between floors and never getting down to the 1st floor. These rungs in Sub must be in the order of lowest to highest, and they work by each floor that has been requested successively overwriting the N7:0 memory storage flag with that floor. So at the last floor requested, its number will be saved in N7:0. Now the elvator knows that lowest floor while it goes down, and when it reaches that floor, it can stop, open the door, wait, close door, then reverse direction and then service all the accumulated UP requests.

What about the "Highest Floor Requested" while going UP? For the 4-floor version, If you notice, when the elevator is at 1, and you press the 3rd floor DOWN call button, the elevator goes all the way to 4, before reversing and going to 3. It really does need a "Highest Floor Requested" routine. I have been waiting for some student to discover that and write one!
 
Last edited:
For a 2-level elevator, could you delete the rungs that determine the lowest floor requested? Test it for yourself. Delete rungs 5, 6, and 7 in Sub 4, then run it to see if it will work.

OK I tested it. It doesn't move without the floor request. At rung 0005 the comment should it say "HIGHEST FLOOR REQUESTED"? I see that the value 41 is put in N7:0 using a MOV and "0" for rung 0006.

The rungs In Sub 4 that determine the Lowest Floor Requested (while going DOWN) help to prevent the elevator reversing back and forth between floors and never getting down to the 1st floor. These rungs in Sub must be in the order of lowest to highest, and they work by each floor that has been requested successively overwriting the N7:0 memory storage flag with that floor. So at the last floor requested, its number will be saved in N7:0. Now the elevator knows that lowest floor while it goes down, and when it reaches that floor, it can stop, open the door, wait, close door, then reverse direction and then service all the accumulated UP requests.

"Who" is picking up the value of N7:0 on the other end, "Source B" of the comparative logic boxes GRT, LES, LIM & LEQ? Source B is N7:0 by default in RSLogix?

Suppose the elevator is on the 4th floor, and someone on the 2nd pressed the DOWN button on the wall. Before the elevator moves, someone rushes into the car and presses "2". Now the car starts and moves down past the 3rd floor, while at the same time a new person back on the 4th floor presses the DOWN button. Where will the elevator go? Should it then reverse and go back to the 4th to pick up the late passenger, or continue in the same direction until it reaches the lowest floor request (1) before reversing and going back up all the way to pick up the guy on 4?

According to the specifications quoted in the previous post, the elevator should not change direction to pick up any passenger unless it have reached its farthest destination call. Meaning that if you have a call for 2nd floor while the car is on at 4th floor, even somebody rush and pressed on the 2nd floor button inside the car before the elevator closed the doors at the 4th floor, I would have to say that it will stop at the second floor no matter if the button was pressed from inside or outside the car for the 2nd floor call. It will pick up the passenger at the 4th floor on its way back like previously stated.

Am I missing something?
EDIT: One the other hand, if a passenger request the 3rd floor from in or outside the car before reaching that level coming from above, it will stop to the 3rd floor because it's on the way down to the 2nd floor.

What about the "Highest Floor Requested" while going UP? For the 4-floor version, If you notice, when the elevator is at 1, and you press the 3rd floor DOWN call button, the elevator goes all the way to 4, before reversing and going to 3. It really does need a "Highest Floor Requested" routine. I have been waiting for some student to discover that and write one!

Yup I understand the need. Not that obvious for a student, it's a vital secondary function to meet the standards.

Cheers.
 
Last edited:
OK I tested it. It doesn't move without the floor request. At rung 0005 the comment should it say "HIGHEST FLOOR REQUESTED"?
No, Rung 0005 is part of the "Lowest Floor Requested" routine. If N7:0 is not first cleared to 0, then the old lowest floor can still be in there if no floor has been selected.
"Who" is picking up the value of N7:0 on the other end, "Source B" of the comparative logic boxes GRT, LES, LIM & LEQ? Source B is N7:0 by default in RSLogix?
The "Who" as you put it is where you can first Unlatch the "Going Down" flag relay B3/3. That is in Subroutine 8-Stop & Open the Door. You can only unlatch the direction relays (Going UP or Going Down) immediately AFTER you have stopped the car. Our program compares the value of the elvator encoder to the value stored in N7:0. If they match, then the elevator has arrived at the Loweset Floor Requsted, so it can safely unlatch Going Down.

Am I missing something?
No, that is the way it works - if the "Lowest Floor Requested" routine is left in the program.
Yup I understand the need. Not that obvious for a student, it's a vital secondary function to meet the standards.
I have to say that you are the first student in 10 years (that I knew about) getting as far as seeing the need for the "Highest Floor Requested" routine. I bet you could (in your spare time!) write such a routine, knowing that it will be similar to the Lowest Floor Requested but "reversed". This new routine needs to end up with a flag relay for each floor greater than the 1st and less that the highest. Of course your 2-floor version doesn't really need this relay because 2 is always the highest floor that could be requested.

For example for the 2nd floor if it is highest, the new relay for the 4-floor version could be called "2 = HIGHEST". For the LogixPro 4-floor elevator, you would then have "highest" flags for floors 2 and 3. These flags would be used in Subs 7 unlatch the Stop & Open relay, and is Sub 8 to unlatch the Floor Request relays for the 2nd and 3rd floors.

I made some comments on your paper (nothing critical), but have not been able to Reply to your E-mail address.
 
Last edited:

Similar Topics

Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,694
Hello, I have a modicon background where there is a "Pulse" function that accepts an input for the deisred pulse time length. I effectively...
Replies
8
Views
2,061
Here is the rungs I have made for my school project: Basically I just press an associated Function Key (F1, F2, etc) on the PanelView to...
Replies
7
Views
1,862
I am learning Rslogix on my own when free time is available at home and have created several simple programs. My question now, is how to change...
Replies
4
Views
2,183
Hello everyone. I would like to thank anyone reading this post. I would appreciate any advice or thoughts on this program. I am a beginner. This...
Replies
28
Views
9,552
Back
Top Bottom