05-30-2016 07:42 AM
Im creating an automated door that will open when the passcode is correct .
Im stuck at where i enter the wrong passcode , the door is still working
What I expect is the door will only work when the passcode is correct.
Can anyone here help me to achieve that
Solved! Go to Solution.
05-30-2016 08:17 AM
You really should only have 1 loop here and I think you would really benefit from learning to use a State Machine.
05-30-2016 08:20 AM
this is hard for me . Whai i need is the connection when only the passcode (123) is correct , then the door part work . Can you help me connect that with my VI ? Im spending hours figure it out how to connect and im lost now 😞
05-30-2016 08:28 AM
@mrspaceman wrote:Im creating an automated door that will open when the passcode is correct .
Im stuck at where i enter the wrong passcode , the door is still working
What I expect is the door will only work when the passcode is correct.
Can anyone here help me to achieve that
If you are new to LabVIEW Please go through LabVIEW Basics and State Machine Architecture.
Few Queries and Suggestions to existing Code.
Use Shift Register Insted of Feed Back Node,
Based on what does the for Loop executes for 100 Times
Single Loop Itself will satisfy your Requirement
05-30-2016 08:29 AM
@mrspaceman wrote:this is hard for me . Whai i need is the connection when only the passcode (123) is correct , then the door part work . Can you help me connect that with my VI ? Im spending hours figure it out how to connect and im lost now 😞
Share your requirements in steps as a pseudo code or with some high level diagram
05-30-2016 08:35 AM
I dont know how to connect between these 2 to get the door only work when the passcode is correct . Any hints ?
05-30-2016 08:52 AM - edited 05-30-2016 08:53 AM
it is impossible to write a program the way you are doing this here. You have events for 10 buttons, but the buttons have no labels so they all look the same on the diagram and the event definitions is unreadable. Never delete the labels, you can always just hide them on the front panel.
Then you have that second loop with weird dependencies. For example if the lock button is true, the state of the unlock button seems irrelevant. What are the valid states of these switches? How is the VI supposed to be used? What is the point of the outer FOR loop???
If you would wire the display indicator to the right of the event structure, you would not need the local variable. What is the point of the timeout case? Seems useless, because the lenght of the string can only occur in the other event, so you could just check there. No timeout event needed.
05-30-2016 09:01 AM - edited 05-30-2016 09:02 AM
@mrspaceman wrote:I dont know how to connect between these 2 to get the door only work when the passcode is correct . Any hints ?
1.Remove the Upper Loop, Transfer the Logical Implementation to Lower Loop inside the TimeOut
2.If For loop has No value Remove the For Loop.
3.Create a Boolean Shif Register with False as a initial Value.
4.In the Button Value Change Event Decide the shift Register value as True/ false Based Password Correct/InCorrect.
5.Use Labels for Buttons.
Attached the Snap Shot of sample Impelmentation "Hope this works for you" but its not the best way of implementaion. its designed in such a way to use your own code to match your Requirement
05-30-2016 09:08 AM
can u send me the code ?
05-30-2016 09:13 AM
@mrspaceman wrote:can u send me the code ?
Modified in LV2014.
If you dont have the Latest Version try to Rebuild using the SnapShot shared