LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I transfer data in Case structure?

Hi,
I have a case structure with 'True' and 'False' cases. I want to transfer a 2D array from True case to False case, how can I do that? Thanks.
0 Kudos
Message 1 of 10
(4,423 Views)
Use a Shift register.

That's the best way to transfer data from one loop iteration to the next.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
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 10
(4,421 Views)
Case Structure also has shift register?
0 Kudos
Message 3 of 10
(4,417 Views)
No, only While and For loops have shift registers, but if your Case is not in one of those, it will only run once and the transfered data will never get operated on.

What is it you're trying to do?

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
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 10
(4,410 Views)
Please see my attached sample code.
The data shows in the array after I click OK button. I want the data keep in the array untill the OK button is clicked again. But right now the data only appear once and replaced by '0'.
0 Kudos
Message 5 of 10
(4,408 Views)
If you need it in both cases, you need to generate it outside the case structure, right? 🙂
Else use a shift register to make the data persistent.

Message Edited by altenbach on 06-10-2005 01:46 PM

Download All
0 Kudos
Message 6 of 10
(4,409 Views)
This is not what I want. I want to show only 20 data in the array once. After I click OK button again, new 20 data show in array. Your code keep updating the data.
0 Kudos
Message 7 of 10
(4,396 Views)
Or, if you only want a new array when and every time you hit the OK button, use the shift register to feed the array back to the indicator. (see attached)

It goes back to 0 every time because on the Flase case you are using the "Use Default if Unwired" mode for the array tunnel. Using this mode does not pass what was last passed through the tunnel, but it passes the default value for that data type. So any numeric data will pass zeros, a string will be an empty string, a boolean will be False, a path will be an empty path...

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
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 8 of 10
(4,392 Views)
Sorry, I accidentally posted the wrong VI.

Another possibility: If you only want to update the display in the true case and don't need the data in the false case, simply place the indicater inside the true case. 🙂

(And as Ed clearly pointed out, place some wait inside yor while loop so in does not spin millions of times per second doing absolutely nothing except comsume all CPU. ;))
0 Kudos
Message 9 of 10
(4,383 Views)
That makes sense, thank you.
0 Kudos
Message 10 of 10
(4,381 Views)