Prince
Member
- Join Date
- Jun 2002
- Posts
- 284
Hello Just a question
I am not sure about the plc you are using but most of the plcs I know even the smallest one do support stacks.
As a novice just to be criticized by others I am suggesting to use an stack based sequence
as you might have some time ( I mean much more than a second ) to up count the counter after detecting a car in any of the gates I suggest to push a value in the stack after any detection interupt on each of 3 gates then when you had enough time and when all the signals went down you will have the time in the next phase to pop your upcount requests one by one and consider about them.
It would be more beutiful if you push a time value in the stack then in upcount phase you can easily detect and omit the unwanted detections.e.g.
if 3 cars enter the gates one by one, you will have
(I am writing in assembly which is the international language)
push 11h /*car entered fome the first gate*/
push 12h /*car entered from the second gate*/
push 21h /*car enterance completed in 1st gate*/
push 13h /*car entered from the 3rd gate*/
push 23h /*car enterance completed in 3rd gate*/
push 22h /*car enterance completed in 2nd gate*/
then when there is enough time ( which I think you would have )
the normal phase can read the stack and do the rest.
I think this can be evaluated to work in Random access memories too
I am not sure about the plc you are using but most of the plcs I know even the smallest one do support stacks.
As a novice just to be criticized by others I am suggesting to use an stack based sequence
as you might have some time ( I mean much more than a second ) to up count the counter after detecting a car in any of the gates I suggest to push a value in the stack after any detection interupt on each of 3 gates then when you had enough time and when all the signals went down you will have the time in the next phase to pop your upcount requests one by one and consider about them.
It would be more beutiful if you push a time value in the stack then in upcount phase you can easily detect and omit the unwanted detections.e.g.
if 3 cars enter the gates one by one, you will have
(I am writing in assembly which is the international language)
push 11h /*car entered fome the first gate*/
push 12h /*car entered from the second gate*/
push 21h /*car enterance completed in 1st gate*/
push 13h /*car entered from the 3rd gate*/
push 23h /*car enterance completed in 3rd gate*/
push 22h /*car enterance completed in 2nd gate*/
then when there is enough time ( which I think you would have )
the normal phase can read the stack and do the rest.
I think this can be evaluated to work in Random access memories too
Last edited: