Problem with SET/RESET logic using two actuators

Hello,
As you can see in the attached screenshot:

  • In Network 1, I placed two actuators (1 and 2).
  • If one of them goes to 1, the DB_Result is set to 1 and maintained via the SET.
  • When one of the actuators goes back to 0, logically the DB_Result should reset.

The problem is that when I switch actuator 1 or 2 from 0 to 1, the RESET also activates at the same time as the SET, which is incorrect.

Could you help me understand where my mistake is, and how I can correct it?

Thanks in advance.
 

Attachments

  • Negative edge sim.jpg
    Negative edge sim.jpg
    79.7 KB · Views: 33
Could you help me understand where my mistake is, and how I can correct it?

Thanks in advance.

The PLC cares not a whit what you want or think it will do, but it will inexorably and mercilessly do exactly what you tell it to do.

What behavior do you want to see? Because the trick is to tell it to behave exactly like that.

The problem is that when I switch actuator 1 or 2 from 0 to 1, the RESET also activates at the same time as the SET, which is incorrect.

Allow me if you please to a be a bit more precise in the language: the RESET is evaluated after the SET, because Rung 1 is evaluated after Rung 2, which is absolutely correct; also, the SET will be evaluated immediately again after Rung 2, but on the next scan cycle when different values might be in any of the memory bits.

However, after re-reading that original post a few times, I think I see the problem. When you looked at the OB1 ladder window (below) in online mode, specifically looking at the (R) reset instruction on Rung 2, you are interpreting that reset instruction's green color as an indication that that reset instruction is being activated; is that correct?

Because what that the color of the reset instruction instead actually is indicating is the value of the operand of the reset instruction, i.e. the (R) being green indicates that the value of "DB_Result".Result was 1 when that reset instruction was last evaluated. You can see that the value of "DB_Result".Result is 1 (TRUE) in the DB1 window to the left. You can also tell that the reset instruction was not "activated" because the rung color at its input (left side) is blue, indicating an RLO (Result of Logic Operation) of False; note that the rung feeding the set instruction on Rung 1 is green, indicating that that set instruction was activated i.e. writing a 1 to the value of "DB_Result".Result.

1757419221542.png
 
Here is another wrinkle, or rather another aspect of the same wrinkle; see the image below.

Note that, on each scan cycle, the new reset instruction on new Rung 1 writes a value of 0 to DB_Result.Result: the RLO feeding the reset is TRUE so the instruction is active; the color of the instruction (R) is blue, so the value of DB_Result.Result immediately after the (R) instruction is evaluated, was 0.

The diagnostic [contact→coil] -| |--( )- logic on the lower branches on Rungs 1 and 3 also indicate what the value of DB_Result.Result was at the time those branches were last evaluated. Note that I have only seen this behavior in Siemens TIA Portal; it may be available in others PLC makes, but none that I have seen; online modes of most PLC software do not indicate the values of memory bits concurrent with the instructions that write those values.

PLC programming is primarily about time, and the scan cycle is the clock; when something happens is more important than what happens.

1757419935000.png
 

Similar Topics

Hi All, This is weird, and i'm stating a the screen not understanding it. I have an AOI, with input parameters. Most of them are booleans. I...
4
Replies
1,553
Views
I have problem with the B&R plc, which I think has gone to reset mode. The following photos give a general overview of communication and problems...
0
Replies
2,260
Views
I have problem with the B&R plc, which I think has gone to reset mode. The following photos give a general overview of communication and problems...
1
Replies
2,364
Views
I have problem with the B&R plc, which I think has gone to reset mode. The following photos give a general overview of communication and problems...
1
Replies
3,472
Views
I have problem with the B&R plc, which I think has gone to reset mode. The following photos give a general overview of communication and problems...
0
Replies
1,974
Views
Top