LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure run other case structure

HI all,

 

I have a big programme in LabVIEW, but what I want to do is very simple to describe with simple example on picture bellow.

 

I need to make that when 1. case structure will be true  to start "second" case (but I also need to start second case manually with switch "START"). Is there any "property node" which will tell me when 1. case is on true?

 

If this exist I then only need to add "OR" boolean to second case.Capture.PNG

 

I hope that is clear what I want to do.

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 1 of 17
(3,530 Views)

Take the boolean wire going to the selector of case structure 1 and OR it with the start button.

 

If you need to run the 2nd case structure after the 1st case structure completes, then just wire the boolean through the first case structure.

Message 2 of 17
(3,529 Views)

Ooo, I forget to add, I know I can add just wire, but is there any "elegant" solution, with "properties" ?

 

 

And also "second" case must be run just once , beacuse "switch" is set as "Switch when released".

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 3 of 17
(3,525 Views)

No, there are no "properties".  And if there were, using the wire is far more elegant than using a property.

 


@hlod wrote:

 

And also "second" case must be run just once , because "switch" is set as "Switch when released".


I'm not sure what the mechanical setting of the switch has to to with whether you want the case structure to run based on the first case.  You'll need to define your requirements more clearly.

 

Set your switch to "Latched when released" and your 2nd case will run once if the button is pressed OR every time the results of the comparison for the 1st case structure is TRUE.

Message 4 of 17
(3,516 Views)

Well if I do as on picture bellow, it will happened first "TEST1" and then continuously "TEST 2", because both case are in While loop"(I can't change this).

But I need to start second case just once a time (for these reason I set switch as "Switch when released". How can I programme that every time first case is true will set second case just once a time for true and than again "false" =?

 

Capture.PNG

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 5 of 17
(3,511 Views)

Well, my second case is actually "camera which is taking " snapshots; and If I add for example "boolean-> 0 or 1" on input of "OR gate" it will not start taking snapshots from camera. But if I changed this for button with mechanical action "switch when released" it's working (the same mechanical action have button START)

 

So what I need is to change this wire from 1 case into something which is similar to "switch with option switch when released" and I hope it will work as I want.

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 6 of 17
(3,500 Views)

I think you are confusing terminology.

 

Switch when release will keep that switch set as True until you come back and switch it off yourself.  Latch when release will keep that switch as true until the terminal is read by LabVIEW at which time LabVIEW will return the switch to false automatically.

 

Case structure 1 will execute the true case as long as X=1.  Are you saying that you don't want the True case of the 2nd case structure to continue to execute as long as X=1?  Only execute on the first time that X becomes 1?  If so, you will need a shift register or feedback node to keep track of that boolean wire and only execute the 2nd case when the boolean wire is True AND when the boolean wire in the previous iteration is NOT True.

Message 7 of 17
(3,499 Views)
Switch when release will keep that switch set as True until you come back and switch it off yourself.  Latch when release will keep that switch as true until the terminal is read by LabVIEW at which time LabVIEW will return the switch to false automatically.

 

Well I need button which goes automatically back to same position as it was after it was pressed, so I used "switch when released", it's also working with "latch when released". It's make no sense. 🙂

 

 

Case structure 1 will execute the true case as long as X=1.  Are you saying that you don't want the True case of the 2nd case structure to continue to execute as long as X=1?  Only execute on the first time that X becomes 1?  If so, you will need a shift register or feedback node to keep track of that boolean wire and only execute the 2nd case when the boolean wire is True AND when the boolean wire in the previous iteration is NOT True.

 

 

Yes exactly that, I will try to use " shift register", so I can get previous  iteration.

 

So I need gate which will do next:

 

wire  | button  | OUTPUT

1         0            1

0         1            0

1         1            0

0         0            0

 

Which gate must I combine to get what I want?

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 8 of 17
(3,492 Views)

Wire AND /Button

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 17
(3,484 Views)

AND is not right, what you mean with this : "Wire AND /Button" ?

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 10 of 17
(3,480 Views)