LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with case structure

Solved!
Go to solution

Well guys, I just want to make a simple thing here but I'm having problem here:

 

I have 2 booleans and if one of them is "1" my case structure should work until I click on stop.

 

But i'm clicking on the boolean the program run one time and after it it just stop.

 

Could you help me? I will attach an image:

 

labview.JPG

 

How can I make the part inside case structure runs until I click on stop?

 

Thanks for the help guys!

0 Kudos
Message 1 of 10
(3,658 Views)

Do you have the Mechanical Action of the OK buttons set to Latch?

 

Lynn 

0 Kudos
Message 2 of 10
(3,653 Views)

EduU wrote:

Well guys, I just want to make a simple thing here but I'm having problem here:

 

I have 2 booleans and if one of them is "1" my case structure should work until I click on stop.

 

But i'm clicking on the boolean the program run one time and after it it just stop.

 

 

How can I make the part inside case structure runs until I click on stop?

 

Thanks for the help guys!


If I have understood this correctly, the logic you want is Exclusive OR, not OR

 

James

 

Edit: You also have a race condition in your VI, Replace the Local with "Reinitialise to default" Invoke node and wire the error out on to the while loop to set Stop to false before you start running.

Message Edited by James W on 05-19-2010 01:11 PM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 10
(3,636 Views)
Probably latch is on. If you want to visualize it, run it with highlight execution on. That will give you a clear picture on what is happening.
0 Kudos
Message 4 of 10
(3,633 Views)

Hi,

 

u may delete the stop button then right click on the terminal (the square with red point) select create control.

 

0 Kudos
Message 5 of 10
(3,625 Views)

The button is "switch until released" and I didn't understand the others comments.

 

I know I have a race condition but this is only an example... my major problem is to know why even with clicking in the button OK the program don't stay running x(

 

I tryed with latch but wont work, only if I clicked on it for ever....

 

Thanks but it wont work yet!

0 Kudos
Message 6 of 10
(3,611 Views)

Does this VI help understand my comments?

 

Does this do what you wanted it to?

 

James

 

Edit: add pic

Case_structure.png

Message Edited by James W on 05-19-2010 01:41 PM
Edit 2: I got the Boolean VI control actions wrong - they are currently switch when released not until
Message Edited by James W on 05-19-2010 01:43 PM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 10
(3,588 Views)
Solution
Accepted by EduU
I am not sure that I understand what you want the program to do.  Looking at it, it appears that the x*y indicator will get a new random number whenever one of the OK buttons is pressed (while it is still pressed - try holdin down the mouse key), and the program will terminate when the stop button is pressed.  Is this not what it is doing?  With an action of switch until released, you will only get a "1" from a boolean as long as you hold down the mouse button.  Try the "switch when pressed" action to have the code in the case continue to run after pressing and releasing.  Also it might work better with a small delay in the while loop.
Message Edited by lmtis on 05-19-2010 07:44 AM
Jim

LV 2020
0 Kudos
Message 8 of 10
(3,587 Views)

James, Now I understood thanks 😉

 

lmtis, you are correct my friend! I did it and works very fine....Now I have to implement it to my program

thanks mate 😉

 

 

0 Kudos
Message 9 of 10
(3,571 Views)

Ok thanks guys, I have fixed that!

 

I was invert something wrong... so my program was ending every time haha

 

thanks for the help!

0 Kudos
Message 10 of 10
(3,551 Views)