How to use the "latch" option/output mode
-
Hello,
Likely a very obvious solution
I need so help setting up logic. Monitoring 2 parameters A and B.If A and B go true, turn on switch
I want it to remain true until both A and B go false.I think it should be done with latch but struggling with how to implement it in MSR.
-
There may be a more concise way to get there, but I think you can do this by nesting groups as follows:
Outer group - "OR" --- Nested group 1: "AND" > Condition 1 > Condition 2 --- Nested group 2: "AND" --- Nested group 2.1 "OR" > Condition 1 > Condition 2 --- Nested group 2.2 "AND" ** > Switch is on Reaction: --- Turn on switch Reset Reaction: --- Turn off switch
** = This selection doesn't matter as there is only one condition in the group
So when the switch is off and Condition 1 and 2 both go true, the first nested group goes true and turns on the switch. At this point the second nested group also goes true as you have C1 = true, C2 = true, and switch = on.
Once the switch is on, if one of the conditions goes to false then nested group 1 will go false, but nested group 2 will stay true, since either C1 or C2 is true and the switch is on. When both C1 and C2 go false then nested group 2 goes false and the rule is reset.
-
Hello,
Likely a very obvious solution
I need so help setting up logic. Monitoring 2 parameters A and B.If A and B go true, turn on switch
I want it to remain true until both A and B go false.I think it should be done with latch but struggling with how to implement it in MSR.
@rogero Using a latch makes it a bit simpler:
Theory of operation: the overall condition of the rule is AND: there are two groups, and for the rule to SET, both groups have to be true.
The first group "Both On" is an AND and can therefore only be true if both switches are turned on at the same time. This group is latched (notice yellow highlight on Options button for the group).
The second group "Either On" is an OR and will therefore be true when either switch is turned on.
If one switch is turned on, "Either On" will go true, but not "Both On," so the rule remains reset. When the second switch is turned on, "Both On" then goes true, and when both groups are true, the rule sets.
Now, the "Both On" is latched true. It cannot go false until its sibling condition "Either On" goes false, so while either switch is on, "Both On" remains latched true and the rule remains set. Only when both switches are turned off does "Either On" go false, which causes the latch to release on "Both On", and the rule resets.
This is a textbook example of latching.
-
@rogero Using a latch makes it a bit simpler:
Theory of operation: the overall condition of the rule is AND: there are two groups, and for the rule to SET, both groups have to be true.
The first group "Both On" is an AND and can therefore only be true if both switches are turned on at the same time. This group is latched (notice yellow highlight on Options button for the group).
The second group "Either On" is an OR and will therefore be true when either switch is turned on.
If one switch is turned on, "Either On" will go true, but not "Both On," so the rule remains reset. When the second switch is turned on, "Both On" then goes true, and when both groups are true, the rule sets.
Now, the "Both On" is latched true. It cannot go false until its sibling condition "Either On" goes false, so while either switch is on, "Both On" remains latched true and the rule remains set. Only when both switches are turned off does "Either On" go false, which causes the latch to release on "Both On", and the rule resets.
This is a textbook example of latching.
@toggledbits And has been bookmarked as such!
-
T toggledbits locked this topic on