LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing values using an event structure

Hi there guys, sorry to disturb you all but i've been trying to do this for 2 weeks now and have had little to no luck. I have done the labview introduction (3 and 6 hours) but i didn't really find them to be too much of help. Anyways enough with my blabbering, i am really stuck on something and was hoping you would be able to help. 

 

I have desinged a front panel that takes numbers as inputs from the user. I want this number to be stored somewhere and when the user presses the ok button and inputs the numbers i want these numbers to be stored somewhere else. I would like these two numbers to be compared and a simple LED to come on. I have done a large amount of it myself but just can't seem to figure out the final bits. 

 

I used multiple strings to see where the values were going but had no luck :(. Can someone please save me 

Just a harmless student
0 Kudos
Message 1 of 16
(5,530 Views)

It is not completely clear to me what you want the program to do.

 

Some suggestions:

1. Use Value Changed events rather than Mouse Down. Also move the control terminals inside their respective event cases. This will cause the buttons to reset to false after they are read.

2. Wire the shift registers through every case, except possibly the Clear case.

3. Because of the initialization of the shift registers with different strings, I do not see how the two values can ever be equal.  I think this is part of the place where I have difficulty with what you want to do.

 

Lynn

0 Kudos
Message 2 of 16
(5,503 Views)

In addition:

 

  • If you want to see anything interesting in the string 6 and boolean indicators, their terminals belong inside the loop.
  • Since the clear button is latch action, it belongs inside it's event case. Make the event value changed, not mouse down.
  • Your timeout case serves no purpose, because it can never be reached.
  • Explain what you mean by "store somewhere" and "store somewhere else". Where exactly is that and in what form?
  • Is this a subVI? How is it supposed to be called and used?
0 Kudos
Message 3 of 16
(5,491 Views)

Firstly i would like to say thank you for replyiing to my thread. 
What i am basically designing is a key pad that remembers the password when you press enter. I need the user to input his password correctly again and as a result the two strings will be equal to each other. I just don't understand how i can do this. 

PS. I have moved all the buttons into their event structures and moved the strings inside the loop but it didn't make any difference :(.

Just a harmless student
0 Kudos
Message 4 of 16
(5,463 Views)

thank you for replying to my post. 

I moved the string 6 inside the loop but it litterally just did what string 2 does. I had so many strings around to see what value was going to different parts of the wire and if anything was actually being stored. I have moved the clear latch inside the event structure but it made no differnt. I have also got my time out to be -1 because i was currently experimenting with my values and didn't want it to timeout while i was testing it. When my VI is finised it will be set to 3000. 
I would like the value that the user inputs the first time to be stored in a string that my VI will remember. After the user presses the OK button, the user will input another value and if this value matches with the first value the LED lights up. 
This is a top level entry and is not going to be part of any sub VI. 
I hope the information i provided to you can clear up any misunderstandings you had of what i am trying to accompalish. 

Just a harmless student
0 Kudos
Message 5 of 16
(5,455 Views)

OK.

 

Try to write down what should happen at each step.

 

For example: 

Prompt: Enter Password

OK button pressed?

     False: Append digit to password

     True: Store password

Prompt: Enter Number to Match Password

Loop:

     Append digit to number entered

     Match?

          False: Append digit to Number and set Boolean False

          True: Set Boolean True

     Clear?

          False: Repeat loop

          True: Exit Loop

 

 

The try to make your VI do what the description says.

 

Lynn

          

0 Kudos
Message 6 of 16
(5,445 Views)

I took what you had to say on board and decided to approach it from a different prespective. I have made this VI (attachment is included). From what i can see everything is done correctly but for some reason Labview keeps telling me that the directory doesn't exist. I have copied the path not typed it so there is no reason for this not to work. They are also both stored in the same directory to make it easier for labview.

Can you please help me

Just a harmless student
Download All
0 Kudos
Message 7 of 16
(5,400 Views)

I'm bored enough this Sunday that if you save it back to LV 2013, I'd be inclined to help you.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 16
(5,374 Views)

When you copied the path you included " marks at the beginning and end of the path name. Try removing them so you can find the other problems. Hint: Ues highlight execution to see what is happening.

 

Lynn

0 Kudos
Message 9 of 16
(5,365 Views)

Bill,

 

Here are versions of his VIs saved to LV2102.

 

Lynn

 

Download All
0 Kudos
Message 10 of 16
(5,355 Views)