06-11-2012 10:46 AM
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.
I hope that is clear what I want to do.
06-11-2012 10:49 AM
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.
06-11-2012 10:51 AM - edited 06-11-2012 10:55 AM
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".
06-11-2012 10:58 AM - edited 06-11-2012 11:00 AM
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.
06-11-2012 11:04 AM
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" =?
06-11-2012 11:27 AM
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.
06-11-2012 11:30 AM
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.
06-11-2012 11:52 AM - edited 06-11-2012 11:53 AM
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?
06-11-2012 12:29 PM
Wire AND /Button
/Y
06-11-2012 12:45 PM
AND is not right, what you mean with this : "Wire AND /Button" ?