LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Door Sensor Timer

Solved!
Go to solution

Hi everyone, I am trying to create a program in LabView and am having some issues figuring out how to do it. I am attempting to make a smart home system for a project, and right now I am trying to create an open door sensor. I have a magnetic contact switch that will be attached to the model door, and when the contact switch is open for longer than 1 minute I want a buzzer to go off, if the door is closed then this will reset the timer (similar to a TON delay timer in PLC, where if the input is true for the preset time then the output would be energized, if the input becomes false the timer resets.) I've so far tried using an event structure, however the event timeout input constant causes all of the operations within the while loop (even if they are not within the event structure) to be delayed by that constant input. I then tried using parallel while loops with the event structure in a separate while loop from the other operations, and in this case the other operations work fine but the door sensor will not work at all. 

 

I am struggling to figure this out so am hoping someone might be able to point me in the right direction. Right now I am just testing out a few of the components individually before linking everything together, so the main while loop is mostly empty and basic.

 

Thanks in advance for any help you can provide, just hoping to be pointed in the right direction so I can have a different viewpoint that I haven't thought about yet.

0 Kudos
Message 1 of 3
(1,466 Views)
Solution
Accepted by topic author lrajo

Sounds like you might want to look up "State Machine".  I think there may be a "Simple State Machine" Sample Project (when you open LabVIEW, do "New Project" and look for Simple State Machine).  See if that gives you some ideas of how to structure your problem.

 

Bob Schor

Message 2 of 3
(1,441 Views)

Thanks Bob! I'll look into it and update here if it works for my problem.

0 Kudos
Message 3 of 3
(1,438 Views)