keypress in specific sequence

johntba

Member
Join Date
May 2018
Location
greece
Posts
10
Hi everybody.I wish you can help me on my project.
I have 5 button connected on the inputs and i want output go to high only after specific compination.for example 1-2-1-5-3 .other compination will reset.pls let me know how i can do it.
Thank you in advance.
 
hi sir.Thank you for your reply.
I have tryed many compinations.To activate output i think is easy but to make specific order is difficult.
 
how do you detect if buttons are pressed at the same time? I would say that you could make an array.
If button "1" is pushed (and no other is), then shift 1 into the array.
If button "2" is pushed (and no other is), then shift 2 into the array.

Lastly whenever 5 numbers have been shifted, you check if the number is what you want it to be. If not, delete everything inside the array and start over.

This shouldn't be massively complicated to achieve.
 
A simple six-step sequence.
Step 1 is rest state, waiting for input.
Transition from step 1 to step 2 is correct button pressed. If any incorrect button pressed, revert to step 1.
Repeat for steps 2 through 6. If the operator successfully gets to step 6, turn the output on.
 
Transition from step 1 to step 2 is correct button pressed.dear Steve can show me one diagramm for this step.thank you
 
Hehe..... sure not do any homework dear Steve ,just i am new in programming.will i need counter or timer or array?
 
can you draw a state machine?
For the 5 digit code you have, how many states you can be in (0 correct ... 5 correct).
When you are in each of those steps, what combination of inputs will allow you to transition either to the next step or return to the first step?
Once you have this, you need to work out:
- how to set a flag to show which state you are in (I like to MOVE a constant value into a DINT called CurrentState)
- when to set the flag.
 
johntba
Hi, and welcome to the forum. I am someone who has never really had formal training or school in PLC programming, but learned A-B all on my own from hours and hours of hammering on logic until I could make it work and also do it in a timely fashion and professional so the customers would be able to understand it as mentioned in several posts in the forum.
I will not do your homework for you either, because you will learn nothing, however I will tell you that I wrote logic to make this sequence work with the buttons (1-5-3-4-2). I will give you the following clues:
I did not use an array, timer, or counter. I used only XIC, XIO and OTE's.
I did it in 6 rungs. I have a PLC and a rack in my office and I tried it and it works.
The second clue is try to remember what you were taught in school about latching or holding circuits. This ought to get you thinking and you can get this. Never give up!! These great knowledgeable pros on this forum will bend over backwards to help you but you must make an initial effort, even wrong logic will at least tell you what NOT to do. Again, welcome to the forum
 
you can use step sequence. no need of timers or counters..
use the the conditions such that set point will activte only when 1 is pressed in this case..
then in that step program add 2nd condition.. and hence proceed.

repeating the number may be an issue,
but counters can help you with it.. work on it.

and one programme will be for one code if you want to change the code change the whole program..

There is a better solution.. but try this one first..
 

Similar Topics

Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
195
I need to dust off RSNetworks DeviceNet next week for a customer, which means I need to get it loaded on my new laptop. I see my old laptop was...
Replies
3
Views
871
Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi again, When the "REPORT" button is pressed (on a different screen), it takes the operator to the...
Replies
7
Views
645
Hello, first time poster here! A belated "thank you" for the direction I've already received from this forum! So, can I do this? Move value 1...
Replies
6
Views
706
I currently have a setup in Siemens S7 using I-Device connections over PROFINET and I am trying to investigate an equivalent setup using Rockwell...
Replies
7
Views
1,112
Back
Top Bottom