PLEG - Logic Struggle

I’ve got a condition that says when the door is unlocked AND the security system is armed then lock the door.

I’ve also got a condition that says when you unlock the door then turn off the security system.

My problem is that when I unlock the door the security system is still briefly armed. I think it’s a timing thing. It then locks the door right away and I don’t want it to.

Can anyone think of how I might be able to handle this better?

That is what sequence expressions solve:

You did not include a status report so I do not know what your inputs and conditions are named … but you can change from something like:

LockTheDoor Armed and UnLocked

to

LockTheDoor Armed and Unlocked and (Unlocked; Armed)

The last part is only true of the inputs turn true in the specified order.

[quote=“RichardTSchaefer, post:2, topic:188085”]LockTheDoor Armed and Unlocked and (Unlocked; Armed)

The last part is only true of the inputs turn true in the specified order.[/quote]

Thanks so much for the help.

I think I get the gist of what you’re saying, although honestly it’s not sinking in all the way. My instinct was to make it Armed and Unlocked and (Armed; Unlocked)

I’ll give it a whirl and see what happens. Attached is the report. cSecureUnlocked is the condition.

I think I get the gist of what you're saying, although honestly it's not sinking in all the way. My instinct was to make it Armed and Unlocked and (Armed; Unlocked)

But you said you did NOT it to lock the door if you just unlocked the door. (i.e. that last term) You want it to lock the Door if you ARM the alarm system AFTER it was previously unlocked.

[quote=“RichardTSchaefer, post:4, topic:188085”]

I think I get the gist of what you’re saying, although honestly it’s not sinking in all the way. My instinct was to make it Armed and Unlocked and (Armed; Unlocked)

But you said you did NOT it to lock the door if you just unlocked the door. (i.e. that last term) You want it to lock the Door if you ARM the alarm system AFTER it was previously unlocked.[/quote]

You are the man! Thanks for the help. Worked like a charm. ;D