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.
I corrected it.There is an error in Sub 4, Rung 0001. IP2 should be IP1.
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...
You use step relays or flags to determine what the multi-plexed input means at each step in the process.
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.
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?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.
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.
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.
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?
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!
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.OK I tested it. It doesn't move without the floor request. At rung 0005 the comment should it say "HIGHEST FLOOR REQUESTED"?
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."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?
No, that is the way it works - if the "Lowest Floor Requested" routine is left in the program.Am I missing something?
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.Yup I understand the need. Not that obvious for a student, it's a vital secondary function to meet the standards.