drbitboy
Lifetime Supporting Member
I've written down without a sequence. I wanted to do it but i dont know how to. If you guys help how to do it in Tia portal i can, its not the same in parky's light system
Well done! It needs some work, but I think you have the understanding to get it right. I especially like how you did the rungs with the timers for the alarms: it shows you understand what is going on pretty well, and can simplify and clarify the needed logic into its best form.
Here are a few comments:
- In Network 1 on the last rung, we do not need the contacts to test bits P2E, M2E and M1e after the contact for bit S1-loop.
- Here is why: after the previous rung, any time the S1-loop bit is 1, then the other three bits (P2E, M2E, M1e) will always all be 1, so there is no need to test them with contacts on that last rung.
- The last rung of Network 1 and the first rung of Network 2 both write either a 0 or a 1 to S2AlarmBit.
- Having multiple unconditional outputs to the same bit is a common beginner mistake
- Do not be embarrassed because we have almost all done this,
- But please remember that it is now your turn to tell the next newbie who does this
- You are also re-using the data block [%DB1 S2_DB_Timer], which I think is not normally a good idea.
- You should be able to combine (OR) those rungs together, or just OR the two <Is S1-loop a 1?> and <Is S1 a 1?> contacts together, then AND that result with the <Is S2 a 0?> contact, feed that into a single timer, and connect that timer's .Q to S2AlarmBit, like this:
- Having multiple unconditional outputs to the same bit is a common beginner mistake
Code:
S1-loop S2 %DB1 S2AlarmBit
--+---] [----+-----]/[------[TON]------( )------
| | T#50s
| S1 |
+---] [----+
- I strongly suggest you switch to @parky's approach. The differences will be that,
- Instead of <Is S1-loop a 1> contacts, you will use Equals instructions like this: <Is CurrentStep equal to 10>, and
- Instead of <Assign 1 to S1-loop> output --( )-- assignments, you will use MOV instructions like this: <MOVe 10 to CurrentStep>
- The biggest benefit will be that you can see the current step (state) of the process by looking at the value of one integer tag, instead of having to check several bit tags.
- Also, another benefit will be that your current step can never be inconsistent i.e. with one bit for each state, it is possible to mistakenly set more than one of them true for any one scan.
- The worst you can do with the integer CurrentStep is set it to a wrong value (e.g. skipping a step), which is easier to debug because the MOV of that value will occur in typically exactly one place,