[Beginner] Help with program for a functional elevator

oreotaxi

Member
Join Date
May 2020
Location
Norway
Posts
2
I've been trying to solve an issue that I've had for several days now and it has now made me give up, which in turn led me to this forum in hope of getting help.

The elevator with 6 extra buttons included (x11-16)
https://i.imgur.com/a0iEXwN.png

I/O-list
https://i.imgur.com/adsHcRj.png

Code from top to bottom
https://i.imgur.com/mwvFytO.png
https://i.imgur.com/OyOlHi7.png

Problem:
So the elevator is supposed to stop for servicing every 5th time it starts, and till then remain out of function until the reset button(X14) is pressed. Now this wasn't very hard to implement but my code makes the elevator stop immediately once the ServiceCounter detects the fifth start instead of going to the requested floor and then stopping.

How would I go about implementing this? I've tried and tried but to no avail.
Thanks in advance!
 
Most of the people here are willing to help with homework as long as you show what you've done so far. Post your work so we can see what you've done so far.
 
Welcome to the forum.


may I suggest the following.
1. write your instructions down in a step by step manner.
2. when done, pretend you are the plc and execute your instructions, writing down what your instructions state.


I am pressed for time, you say your program works, ok.
you said stop the elevator at the beginning of every 5th cycle and that is what your program is doing. but you also say you want it to stop at the end of the 5th cycle. so which is it?


this is why I say write down your instructions so that you understand them.


if its the end if the 5th cycle, you are stopping the elevator at the start of the 6th cycle, not the 5th.


if its the end, here's a hint, what tells the plc you are at the end of the commanded move?


james
 
There are a few things that do not make sense, you only increment the counter on the elevator down so it maybe it could be 10th run in theory is this correct ?
What are X11 & X12, these have no comments, where is your current counter done bit ? etc.
What you need to do is inhibit the Level move memories on the count so for example:
On level 3 and button for level 2 and not counter SET level 3>2 bit
(this sets the bit to move from level 3 to 2, the counter is incremented that in turn disables the setting of any move level latch)
So if you put not the counter in all the SET's that initiate the run up/down bits then if a button is pressed, this sets a memory to move from one floor to another, the counter increments and the output of the counter disables any of the latches from being set again until the counter is reset.
 
There are a few things that do not make sense, you only increment the counter on the elevator down so it maybe it could be 10th run in theory is this correct ?
What are X11 & X12, these have no comments, where is your current counter done bit ? etc.
What you need to do is inhibit the Level move memories on the count so for example:
On level 3 and button for level 2 and not counter SET level 3>2 bit
(this sets the bit to move from level 3 to 2, the counter is incremented that in turn disables the setting of any move level latch)
So if you put not the counter in all the SET's that initiate the run up/down bits then if a button is pressed, this sets a memory to move from one floor to another, the counter increments and the output of the counter disables any of the latches from being set again until the counter is reset.

I'm sorry about how unclear my code was, I should've explained my code and problem much better.
First off, in the previous exercise, I was asked to use two buttons, which in my case were X11 & X12, and implement them in a way which gave me a way of manually controlling the cage in case it got stuck between any of the floors. That what those two are.

Secondly, I'm not quite sure what happened with the counter's inputs because I had a OR-function consisting of Elevator Up and Elevator Down earlier that day. My best guess is I had to have had accidentally deleted Elevator Up when I was translating all the variables to English because prior to that, it was all written in Swedish as that's my first language.

Lastly, can you expand on the example you gave me? I don't quite understand.

...And thanks for the reply!

EDIT: Here is the updated ladder code
https://i.imgur.com/KsPZsP5.png
https://i.imgur.com/xHz2Zpm.png
https://i.imgur.com/zW7GUAj.png
 
Last edited:
Instead of Oring the service counter around the RESETS, AND Not them in the SETS
So for example, all Memory levels that send the car up or down you use not contact off service counter so if the latch is set by the button then when it moves it increments the counter but continues to the level but as the counter is now true, it will not allow another button press set any of the move to level memories
SERVICE COUNTER
---| |-----| |----------|\|------------(S) Memory level 2
 
The

  • LD Sensor level 3/1
  • ORI Sensor level 1/3
pairs on rungs 14 and 15 are unnecessary because of the single


  • LD Sensor Level 1/3
before them on the same rungs. I.e. if the initial single LD evaluates the rung to True or False just before the LD/ORI pair, then the rung state after the LD/ORI pair always will be the same.


Also, since it's unlikely [Sensor Level 1] and [Sensor Level 3] will ever both be true at the same time, [LD Sensor Level3] is redundant when ORed via [ORI Sensor Level 1], and vice versa. E.g. the unique case of [Sensor Level 3] being 1 is a subset of the more general case where [Sensor Level 1] being 0, so it makes no sense to OR those two together.


I think it would helpful for you to find Ron Beaufort's 90-minutes of videos, starting here https://www.youtube.com/watch?v=T3tnXu-Eywc; they should clear up a lot of confusion.
 
Drbitboy is on the ball, this is called re-visiting the process and find redundant code, not essential and can be useful as well as a hinderance. sometimes lengthy code can result in a more readable logic as far as de-bugging but means there is more to look at, on the other hand, incorporating logic round existing rungs (reduce number of rungs, save memory and in some cases it can make it easier to understand and very often reduces errors as one bit of code could cause other problems) That last bit is hard to explain but many on this site will have come across code where it does not make sense i.e. there seems to be a rung of code that never actually does anything (usually the process of de-bugging when things do not work correctly so code is added, it did not work and another tak is used, forgetting to remove bits that did not work). I did not look to closely at the code as you claimed it worked well with the exception of the service part. I hope I explained the process of the inhibit to stop the next button press from setting a route bit.
 

Similar Topics

First I'm am using the logixpro trial version form the learning pit. I'm having some problems with a program. I need some help. It would be...
Replies
6
Views
2,925
So to start off: I have no experience with PLC's, but I'm good at figuring stuff out, but I need some help to know if my PLC is just dead in the...
Replies
2
Views
114
First time poster here so long story short i built my own trainer at work so i could toy around with various things and test things and learn...
Replies
25
Views
2,146
Hi all, this is my first thread on here, completely new to plc. Have been given a 1769 L24ER QB1B to play with. I have a PA2 power supply and a...
Replies
3
Views
1,795
I'm event AV Technician (Sound, Projection, and Lighting). Over the last couple of years I've used a Weigl ProCommander PHX to control some event...
Replies
9
Views
2,693
Back
Top Bottom