Quickie Problem

Waidesworld

Member
Join Date
Jul 2002
Posts
11
I have a quick question. My ladder is set like so...

|----[ x1]--------------------------------( y1 )
| | |
| | |
|-[ x2]- ----( y2 )


Doesn't this mean if I close X1 or X2 that both Y1 and Y2 should activate.
I am trying to test this but when I input X1 or X2, I have no reading on the Y side.

What am I doing wrong here?

WW

Well the post looked different but what I am saying is that x1 and x2 are in parallel (two entrances to a parking lot) and Y1 and Y2 are also parallel, two results for counters etc.
 
You don't mention what brand of PLC you are using, but on some brands you cannot use the same X1 & X2 number for the Y1 & Y2. What I am saying is that if the number 1 is used for an X you cannot use it for a Y. Not sure if this is your problem or not. Just a thought.
 
Originally posted by Waidesworld
I have a quick question. My ladder is set like so...

|----[ x1]--------------------------------( y1 )
| | |
| | |
|-[ x2]- ----( y2 )



Doesn't this mean if I close X1 or X2 that both Y1 and Y2 should activate.


Yes, depending on the PLC. Some brands do not allow multiple outputs. You don't state the brand.

I am trying to test this but when I input X1 or X2, I have no reading on the Y side.

What am I doing wrong here?


Several things:
First, since you say you are not getting "a reading" on the Y side, is the code being scanned? If the rung is in a subroutine, is that subroutine bein called? Do you have an MCR instruction that is preventing the code from being scanned. Your gut feeling is correct, the code should work. So why doesn't it? You've got the code, not us. We can only make educated guesses

Second, what is the difference, logically, between Y1 and Y2? The way you have it shown, you could use either one interchangeably in your program. That's sloppy and wasteful. Give one of them a functional name (like "A car has entered the lot - increment counter), and use the one throughout. If they are truly different (one being a coil, the other a counter), and if your PLC supports branched outputs, then you're OK. But good annotation is still the key to success.

Well the post looked different but what I am saying is that x1 and x2 are in parallel (two entrances to a parking lot) and Y1 and Y2 are also parallel, two results for counters etc.

Ah, the old parking lot problem. Which school uses that one again? - I can't keep track?

When you post ladder, put the html codes [lad<tag>der] and [/lad<tag>der] around the code so that the spaces don't get lost.
 
I am a Dumb ***

I just remembered my very first lesson in PLC programming from seven years ago. ALWAYS HAVE AN END COMMAND AT THE END OF THE PROGRAM.
Thanks to all for your quick responses.

My next issue is this. If I get X1 or X2 then the output is Y1 and Y2. However, if X1 and X2 were to occur at the same time then I also need Y1 and Y2 to increment twice.

And yes, the system is two lanes with Loop Detectors and two incremental counters, one of which (Y2) is resettable and the other (Y1) is non resettable.
 
Re: I am a Dumb ***

Waidesworld said:
My next issue is this. If I get X1 or X2 then the output is Y1 and Y2. However, if X1 and X2 were to occur at the same time then I also need Y1 and Y2 to increment twice.

Congrats - you've correctly identified one of potential flaws in your code. Some others (with timing diagrams for explanation:

Two enter simultaneously, but exit the "entry beam" at different times:

_____
| |
A:____| |__________

__________ Correct Count = 2
| |
B: ___| |_____




Two enter in the time it takes one to enter (EZ Pass):

_____ ______
| | | |
A:____| |______| |____

___________________ Correct Count = 3
| |
B: ___| |_____




Or

____ ____
| | | |
A:_______| |___| |____

___________________ Correct Count = 3
| |
B: ___| |_____




Cars entering rapidly, so that at least one eye is always covered

_______ _______ _______
| | | | | |
A:____| |___| |____| |_____

________ _________ Correct Count = 5
| | | |
B: ________| |___| |___________




Hint:
Don't think of it as incrementing the counter twice, but of counting a lane as the car comes in.
 
In that case...

Should it be like this then

If x1 then y1 and y2, set tmr=0.2
If x2 then y1 and y2, set tmr=0.3
If x3 then y1 and y2, set tmr=0.4
END
Since it is a pay station the cars won't be whizzing
 
No good - you just shifted the problem in time. Now if instead of X1 and X2 arriving simultaneously causing a problem, if X1 arrives 0.1 sec after X2, you have the problem. (Where did X3 come from? Do you now have 3 entrances?)

A counter needs to see a low-to-high transition in order to increment. You need to create logic to perform the following timing diagram:


+---- 2 cars enter simultaneously
|
V
_________________
|
X1: ___|

_________________
|
X2: ___|

= = = = = = = = = = = = = = = = = = = = = = = = = = =

Ladder Logic: ->| |<- 1 scan width
_
| |
X1': ___| |__________
_
| |
X2': _______| |______
_ _
| | | |
X1' AND X2': ___| |_| |____




I don't assume that cars are whizzing by.
I picture it more lke bumper-to-bumper, with small gaps in between. I probably should have put elipses on my timing diagrams to illustrate that.

<hr>
EXTRA CREDIT
As the car rolls onto and off of the loop detector, there will be, at certain points, just enough pressure for the sensor to detect the car. But since a car vibrates, it may be detected, then not be (albeit breifly) several times before being fully sensed.
Timing diagram:

+--- Car Enters . . . Car Exits ---+
| |
V V
____________ . . . ___________
| |
Car: ___| |________

_ _ __________ . . . __________ _
| | | | | | | |
Sensor: __| |_| |_| |_| |______



Create "debounce" logic to ensure that only one car is counted.
 
Last edited:
Hey, why don't you use a different counter for each entrance?.
In such a way you can count indipendently, and without problems due to simultaneous entrance, the number of cars entered in each gate. You can then add the values of the counters to know the total number of cars. The same for the n exit gates.

Ciao, Luca
 
Last edited:
Different Counter Solution

The customer supplied the specs. I actually have a different counter for each gate but they also requested a set of master counter.



And Allen, there are three entrances, I thought if I could solve the two entrance problem then adding the third would just be another variable.
 
Hello Timothy,

I understand that the customer specified a master counters.
Does it really matter if you provide the master counter as a sum of more partial counters?
I don't see a real difference, except for a greater flexibility and reliability of the system, and I don't think the customer is going to see any differences

Ciao, Luca
 
Sometimes you have the obligation to tell the customer they are wrong. This is always true when they specifiy something that would cause safety problems, and is usually true when they specify a detail of program structure that will interfere with getting the results they really want.

In this case the customer doesn't really want a combined COUNTER, he wants a combined COUNT. If you total two or three separate counters, he will get the data he is looking for.

There is no way to tie two or three inputs to a single counter and insure an accurate count, unless you can insure that only one input at a time will be tripped AND insure that the first input has dropped out before the second is tripped! Remember, counters count off-to-on transitions. If one input is already on when the second trips, the counter will not see a transition and will not increment the count.
 
Parking Lot

It's located at one of the State Parks in New England. For privacy concerns I can't be more specific. I can't see why it can't be done. The PLC is supposed to handle issues like this. Basically each booth has the individual booth tally with the master booth having the total tally.

Not all booths are open at all times and only certain people have access to the master booth. hence the set up. The supervisor wants to glide by in the evening and take the tally (not open all the booths and pull out a calculator) then reset one of the counters and audit the other counter. it's a cost saving technique.

Now that people realise I am on a deadline, I am going on vacation on Friday and they needed it by the 4th of July, can someone please help me.

Much appraciated,

Waide

overview.jpg
 
You aren't listening, Waide!

1) It is IMPOSSIBLE to get three separate inputs to trip ONE counter accurately. The first time a car pulls up at a gate while another car is still in the first gate, the count will be off!

2) If you take the individual booth tallies and add them together and display the total, you will have met the supervisor's functional requirement!
 

Similar Topics

Does the Powerflex 40 At Reference status bit fluctuate or is it a solid at a given speed reference once the ramp completes (assuming no...
Replies
4
Views
4,477
Hi, I have a customer who has cleared a virus by completely reinstalling the PC. Now the problem is he has to reset his RSLinx license that I...
Replies
2
Views
2,044
Hi, can the Rades modem have a different IP range than the PLC/HMI's connected to it? I'm trying to connect to a customers site. The modem is...
Replies
10
Views
2,446
Hi I found this the other day and now for the life of me i cant seem to find it again!! Where do i find the FORCE command in GX while online ?
Replies
15
Views
4,919
Hi This is probably a question with a very simple answer but its late and I can't figure it out. If this is me being a complete buffoon then...
Replies
5
Views
2,298
Back
Top Bottom