Hello,
I am trying to make a sequence program by using MOV function to change the value of a register. So far I have always used SET and RSET for sequencing but sometimes it happened that 2 steps were active in the same time even though they were not supposed to. To avoid this problem, I want to make the sequencing by changing the value of a register. Since it can only have 1 value at a time, it can never happen that 2 steps will be active in the same time.
I wrote a small test program but it is not working on they way I want it to work.
When the PLC turns on, &0 is moved to D0, lamp0 is on to indicate that step 0 is active. When I give the condition for step 1 (push button1), &1 will be moved to D0. When D0=&1, lamp1 turns on indicates that step 1 is active and lamp0 should turn off because step 0 is not active anymore. When D0=&1 and I give the condition for step2 (push button2), &2 will be moved to D0 and lamp2 turns on to indicate that step 2 is active and lamp1 should turn off. Until that point it works just fine, but when step 2 is active and I turn button 1 off, which is the condition for step 1, step 0 activates again. When step2 is active, it should be active regardless of the conditions of the previous steps. What can be the problem?
I upload my program and if you have time, you can take a look at it.
Thanks!
I am trying to make a sequence program by using MOV function to change the value of a register. So far I have always used SET and RSET for sequencing but sometimes it happened that 2 steps were active in the same time even though they were not supposed to. To avoid this problem, I want to make the sequencing by changing the value of a register. Since it can only have 1 value at a time, it can never happen that 2 steps will be active in the same time.
I wrote a small test program but it is not working on they way I want it to work.
When the PLC turns on, &0 is moved to D0, lamp0 is on to indicate that step 0 is active. When I give the condition for step 1 (push button1), &1 will be moved to D0. When D0=&1, lamp1 turns on indicates that step 1 is active and lamp0 should turn off because step 0 is not active anymore. When D0=&1 and I give the condition for step2 (push button2), &2 will be moved to D0 and lamp2 turns on to indicate that step 2 is active and lamp1 should turn off. Until that point it works just fine, but when step 2 is active and I turn button 1 off, which is the condition for step 1, step 0 activates again. When step2 is active, it should be active regardless of the conditions of the previous steps. What can be the problem?
I upload my program and if you have time, you can take a look at it.
Thanks!
Last edited: