LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure run other case structure

Are you sure you shouldn't be using parallel loops? You stated the second case was dealing with a camera and just needed to start a particular time. If your camera code were in a second while loop you would use messages via a queue to tell it when to start and when to stop. Then the camera would run indepently of the other code.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 11 of 17
(872 Views)

Yes actually I have two while loops and these two cases are iside of it's. I think I need just "shift register" and with gates make this:

 

wire  | button  | OUTPUT

1         0            1

0         1            0

1         1            0

0         0            0

 

but for now I don't with which gate can I get that output.

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 12 of 17
(865 Views)

Try createing a boolean array of your various conditions and then convert that to a number. Then your case would decide based on the number. So, in your example you would only set the output to 1 when the numberic value is equal to 2. That is assuming that button is in position 0 of the array and wire is in position 2.

 

I am still wondering if you should have both case structures in the same loop. If they are in different loops and you are wiring one to the other they will run in sequence since there is a data dependency between them.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 13 of 17
(862 Views)

I think yamada answered yur question but you may not have understood.

 

Wire ANDed with Button inverted.

 

YOu can use a compound artihmatic node and right-click it and choose "And" mode.

 

Right click the Button input to the gate and choose Invert to code up what you asked for.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 14 of 17
(860 Views)

Hi all, still don't get it 😕 I add picture which minimalize all my code (you can see 2 loops)

 

But if I wired like this on picture it's not working even "START" button anymore 😕  I need when "x" value become "2" will take one snapshot on camera (like this do "start" button)

Capture.PNG

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 15 of 17
(849 Views)

Your second loop will not run until the first loop exits. I suggest you take a look at the producer/consumer examples for appropriate methods for communicating between two parallel loops.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 16 of 17
(843 Views)

Uff too much complicated for me 😕

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