ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure Problem

Greetings all,
 
I know this problem may seem VERY easy, but I am going to throw it out there anyway.  I would like to have a boolean switch (true/false), where if pressed it is the true case, if not, the false.
 
If the switch is pressed (true), I would first like LabVIEW to wait 1 minute.  After 1 minute, I would like to make an array of two elements to say "Bad."
 
If the switch is not pressed (false), I would like LabVIEW to just create a string array of two elements that say "Good."
 
My problem is the delay of 1 minute.  It doesn't seem to work.  Whenever i delete my Wait.vi, my VI works fine.  I think this may be a problem of where I'm placing my Wait.VI
 
I'm attaching my VI, I'll appreciate ANY help!
Thank you!
Amal Patel
0 Kudos
Message 1 of 13
(4,384 Views)
Hi,

I improved your VI a bit... tell me if this is what you need 😉

Hope this helps

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 13
(4,373 Views)
Amal,

Your wait is set to 1200000 milliseconds = 1200 seconds = 20 minutes. Other than that, it works for me. I shortened the delay for testing. What, exactly, does it do when you say, "It doesn't seem to work?"

Lynn
Message 3 of 13
(4,371 Views)

Okay,

So the delay is WORKING, but in both cases.  I only want it to work in the False Case.  To illiminate time, I shortened the delay to 5 seconds only.  When I flip the switch, LabVIEW waits 5 seconds, then fills an array of "Bad."  When I flip the switch to the False, it waits 5 seconds again!  I don't want this delay in the False case.  Any way to work around this?  I'm re-attaching my VI.

Amal Patel
0 Kudos
Message 4 of 13
(4,364 Views)
Amal,

I cannot open your VI (don't have LV 8), but if want just to wait 1 minute, you can use the "Wait ms" vi (see attached image).
Could you post an image of your code or a LV 7.1 version?

Rasputin
LV7.1 <> W2K
Message 5 of 13
(4,365 Views)
Amal,

While the Mark Bad? button remains true your program will continually start a new delay as soon as the old one finishes. That is what causes the delay you see on returning to false.

I modified your program to use an event structure. It also blanks the Bad Array one second after each change to show the effects.

Lynn
Message 6 of 13
(4,352 Views)
I am using the delay, but it's working in both cases.  I only want it to work in the True case.  I'm attaching a screen shot of both cases. 
Thank you!
Amal Patel
Download All
0 Kudos
Message 7 of 13
(4,349 Views)

Problem Solved.

Johnsold (Lynn), you are brilliant!  Thank you so much.  Thank you to the rest of you for all your help! 🙂

Amal Patel
0 Kudos
Message 8 of 13
(4,332 Views)
How would I create another case?
 
That is, after I click the button, it'll wait 5 seconds and make the array "Bad."  I want my application to work in this order:
 
Click "Mark Bad" button > After 5 seconds make the array say "Questionable" > After an additional 10 seconds elapse make this same array say "Bad".
 
I hope this makes sense.
Thank you! 🙂
Amal Patel
0 Kudos
Message 9 of 13
(4,266 Views)
Allow me to re-attach the VI I am using, Mark Bad 3.vi.
Amal Patel
0 Kudos
Message 10 of 13
(4,264 Views)