LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting 2 cases

Solved!
Go to solution

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

0 Kudos
Message 1 of 22
(3,590 Views)

You really should only have 1 loop here and I think you would really benefit from learning to use a State Machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 22
(3,572 Views)

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 😞

0 Kudos
Message 3 of 22
(3,567 Views)

@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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 22
(3,564 Views)

@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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 22
(3,562 Views)

I dont know how to connect between these 2 to get the door only work when the passcode is correct . Any hints ?

0 Kudos
Message 6 of 22
(3,555 Views)

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.

0 Kudos
Message 7 of 22
(3,543 Views)

@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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Download All
0 Kudos
Message 8 of 22
(3,539 Views)

can u send me the code ?

0 Kudos
Message 9 of 22
(3,528 Views)

@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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 22
(3,519 Views)