LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data in case structures Labview 6.1

I have a simple case structure consisting of 4 frames inside a while loop. I want to pass data from the 3 cases thru the while loop and display on indicators.

After running the vi only data from the last case is displayed on the indicator.

How do I pass data from each case to the indicators?
Attache dis the simple vi to show the problem.
0 Kudos
Message 1 of 5
(3,020 Views)
If you don't have the data from the first three cases running to a shift register and back through each case, then whatever you have wired to the tunnel in the final case will be what ends up being passed out of the case and onto the While loop.

If you are using the "Use Default if Unwired" option on the tunnel, the default value for that data type will be passed out. This would be a 0 for numerics, and empty string for strings, False for booleans.

If you do have everything wired through shift registers, something strange is going on. try posting an example of what you are doing so we can see it.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 5
(3,020 Views)
ED, Thanks for the respose. I may have a solution
using local variables but I don't like it to much.
I have attached a simple vi file to show my problem
with and with local vaiable
0 Kudos
Message 3 of 5
(3,020 Views)
Using Local Variables is almost never the way to go. Sometimes they can't be avoided, but most of the time there's another way.

I've modified your example a bit. The new loop below your original one will do the same thing, but without using variables. The For loop automatically indexes through the array and will process each element. The Shift Registers pass data from iteration of the loop of the next, so the values from the first iterations will stay around so they can passed out of the loop.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 5
(3,020 Views)
Ed, Thanks, Your solution works perfect and is exactly
what I need.
0 Kudos
Message 5 of 5
(3,020 Views)