A beginner problem with the latch

Alyelhefni,

If you want help troubleshooting your program, you must turn on "View, Sybolic Addressing", then take the pictures of your networks. Without any English text symbols, I cannot help you very much with figuring out why it is not working. Apparently you can't figure it out either, and I can see why. Without the symbols it is a coded puzzle with no key. At least you could type in Titles for each network, with each Title being a sentence that explains what the network is supposed to DO, and maybe add some network COMMENTS that list a NAME for each address used in that network.

Here are a few things I can see even without any symbols, titles, and comments:

(1) You need at least TWO 2-second timers. I see only one (T2). One 2-second timer is to stop Conveyor #1 for 2 seconds while S2 looks at the Product to decide if it is Faulty or Good. The other 2-second timer is to measure the ON time of the FLAPPER to kick off Faulty Products.

(2) Using Set and Reset relays makes your program approximately 2 times longer.

(3) I am not familar with the type of Counter you are using, but for most of the counters that I do no about, the Trigger or Set input must be wired to a device that goes on and off, such as the Sensor # 3 that you are supposed to use. That means that you need a ---||--- normally open contact connected between your power rail and the Counter S terminal. Without that it probably will not ever count. Also, this counter can not be be reset with one of the Sensor inputs alone. The sensor Inputs alone cannot tell you if the Full Box has been moved down Conveyor #2 AND a new box has been moved into the Fill Position.

(4) Sensor 4 can tell you that a new box is present, but by itself S4 CANNOT tell your program all it needs to know (that S4 was ON, then OFF, then ON again), completing one box of 24 products AND moving a new box into position. These conditions CAN be determined by a combination of looking at the Counter bit AND the S4 bit AND the Conveyor #2 Output bit. Without knowing these things, your State Diagram is just a pretty picture, fat, dumb and happy that it knows nothing of some states that exist but are not shown or used. That is the problem with State Diagrams: they only work if every single little unnoticed but possible state is included. If not, there are gaps in the logic. Loooking at your 6 States, I can see that there probably are about 10 to 15 States in this project. I handled this state-logic gap in my program by adding another Timer T2 (others are T0 and T1), set for 2 seconds also. When Conveyor #2 starts, this timer T3 is to allow a Full Box of 24 to move off of Sensor S4, so that it turns on a "MOVE_FULL_BOX" M relay, self-seals itself ON, and S4 then goes from ON to OFF (no longer sees a box). Then Conveyor #2 moves the full box downstream for some time period (who knows how long to get to the end?), at least long enough for S4 to go OFF. Now we must wait until a new empty box shows up (drops down from above?) and S4 goes ON again (completing the ON-OFF-ON cycle of S4). Then we can STOP Converyor #2 (I think it is Output Q1.2 in your program), and then also allow Conveyor #1 to restart.

(5) I know Siemens loves the Count Down counters, but in this case you are counting Products UP as they go from 0 to 24 to fill a Box. Why make it complicated and counter-intuitive? The Count Up Counter that I used is shown in the picture. The Preset Value can be a simple constant of "24".

Siemens S7-200 Count Up Counter.jpg
 
Last edited:
Well, it works except for the counter and I don't know why yet.
I suspect that the Counter is just the most obvious problem right now.

Study the attached picture where I have pulled out all your rungs with "M1.1" as an Output. They are in the same order as in your program. I don't know what M1.1 is, or does, or what the heck it is supposed to do. But I can see some problems just looking at the common addresses. (If only you would publish a list of your addresses, and what each is defined to be, then I could really ZOOM in on your problems).

Look at the first network where you Set (latch) M1.1 ON. It will override the other two later rungs where you Set M1.1, so they will have no effect when M0.0 is ON. Now what is M0.0? I wish I knew and knew when it is ON!

Now look at the last network where you Reset M1.1. Again you use M0.0. This does not seem logical that you should use the same bit that SET M1.1 to also RESET M1.1! M1.2 is in there also. I wish I knew what M1.2 is supposed to be!

Alyelhefni's Problems.JPG
 
Because you are trying to use a State Diagram, I have tried to find the missing states, and improve it so it can be used to create a working program.

Alyelhefni's State Diagram R1.JPG
 

Similar Topics

I am trying to connect to SLC5/03 using an FTDI usb to rs232 with female to female converter at 1 end... however I can not connect to it ... the...
Replies
8
Views
1,281
Hi, Sorry for my bad english, I'm from Poland. I've decided to learn basic PLC programming as hobby and to maybe get a better job. I have...
Replies
2
Views
1,342
I'm trying to teach myself how to use factorytalk so I can add buttons, screens and other cool junk and am having trouble testing my application...
Replies
2
Views
1,914
Hello everyone, I am a very basic beginner of PLC; I am currently in a class where we are going over PLCs. We have to complete Programmable Logic...
Replies
7
Views
2,867
hello , everybody , i just begin to learn how to program for the mitubishi plc. following is the program for control the speed of pump. who can...
Replies
3
Views
5,837
Back
Top Bottom