02-27-2012 08:09 AM
Hello,
In my current program, I am trying to carry a boolean signal (Time Elapsed) out of a case structure to stop a while loop.
http://zone.ni.com/images/reference/en-XX/help/371361E-01/loc_bd_casestatus.gif
The while loop on the left is basically what I want to do yet whenever I do this, I get a green tunnel box with a white center. It will not allow me to run the program saying that there is a missing assignment to tunnel. What can I do to get around this?
Solved! Go to Solution.
02-27-2012 08:22 AM
Hi booxcar,
Nothing looks wrong with the image you've attached but if you check your code, make sure that there aren't any empty case structures hanging around. With the image you attached all booleans leaving the case structure are connected. Granted, if you haven't fixed it already, you'll need to change the constant to false after Test 2 runs otherwise your while loop will never finish executing.
Feel free to attached the code if you're still having problems.
-Tim
02-27-2012 08:24 AM
The image that I have shown is a picture of what I am trying to do and not a picture of my actual code. My code is more or less the same in terms of structure except the tunnel is white in the middle.
02-27-2012 08:27 AM
Your question is extremely basic. Have you done any of the LabVIEW tutorials, or looked at the Help file? A tunnel is the mechanism for passing data to the next node. All case items must generate data. Either provide the data, or right-click on the tunnel and select "Use default if unwired". For Booleans the default is true.
Please do the LabVIEW tutorials and read the Help file.
To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.
02-27-2012 08:28 AM
The white centre means that there are some of the cases in which you do not have a boolean wired to the output tunnel. The value of the output tunnel is the value that is wired to in in the case that executes, so a value must be available in every case.
There are two possible solutions.
1) [Normally preferred] Wire a boolean to the output tunnel in every case. The output tunnel will then go to a solid colour.
2) Right click on the tunnel and select "Use default if unwired" You will notice that the white centre will get smaller. This is like wiring a false constant to each of the cases that currently have no wire. The disadvantage here is that this can obscure logic errors. You might have intended to wire something there but didn't, and no syntax error was flagged.
Rod.
02-27-2012 08:39 AM
Attached is a picture of an example code of what I am trying to do and the problem that I am presented with. In my actual program, the boolean control is in the form of an Elapsed Time.. What am I exactly doing wrong?
02-27-2012 08:41 AM
Ah, got it. Well then I definitely would recommend rifling through all the cases and checking to see that there are no empty ones. Easier than that is right-clicking on the case structure and selecting "Remove Empty Cases".
You can use the "Use Default if Unwired" option but like was mentioned this can cause unwanted errors and with booleans it's always better to wire a constant to every case. In your case, if you are using the "continue while true" option on your while loop then using the default if unwired option would cause the while loop to stop since the default value is actually false with booleans (Unless the default value option is smart enough to know that it is connected to a continue while true conditional terminal...someone please correct me if I'm wrong). You can verify that the default value is false (normally) with this code below. Case 0 has the defualt if unwired set and case 1 writes true.
02-27-2012 08:41 AM
Oh, nevermind, I understand what you mean by having to wire to all cases... Just flew over my head for some reason.. Thanks for the help!