LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tunnel output unwired: using previous value from other cases

Hi,

 

so I have only seen discussions on the idea exchange about this opic (at least that i could find), but not anything that is actually a work around. I would like to use the values from previous cases as they are being itterated through. I have a for loop that has 3 numerical cases (0,1,2) and in each case there is a large array that is capturing data being measured that is then being divided into sub arrays to be used later outside the case structure and loop. however, each time the structure itterates to the next case, the previous values are overwritten and are output as empty arrays. Is there anyway to make it so that the previous sub arrays from earlier cases are not overwritten? or any other work around that i could use? perhaps some kind of other default case? I've attached my code and there are pictures below that focus on the area i mean (it's messy i applogize i'm pretty new at this.)

 

 

Thank you very much,

 

any suggestions would be great. I've been stuck all day.case 0.png

0 Kudos
Message 1 of 5
(2,240 Views)

aaaaaaaaaaaaaaarghhhhhhhhhhh.......409KB worth?  i am getting dizzy...shift registers in your loop is your key word here  Smiley Wink

 

note: i smell RG

0 Kudos
Message 2 of 5
(2,235 Views)

@CRivett wrote:

Hi,

 

so I have only seen discussions on the idea exchange about this opic (at least that i could find), but not anything that is actually a work around. I would like to use the values from previous cases as they are being itterated through. I have a for loop that has 3 numerical cases (0,1,2) and in each case there is a large array that is capturing data being measured that is then being divided into sub arrays to be used later outside the case structure and loop. however, each time the structure itterates to the next case, the previous values are overwritten and are output as empty arrays. Is there anyway to make it so that the previous sub arrays from earlier cases are not overwritten? or any other work around that i could use? perhaps some kind of other default case? I've attached my code and there are pictures below that focus on the area i mean (it's messy i applogize i'm pretty new at this.)

 

 

Thank you very much,

 

any suggestions would be great. I've been stuck all day.



Yes, you can preserve values using two methods:

 

1. Shift Registers (an example of both implementation are shown in attached vi), or...

2. Feedback nodes

 

In your diagram, it maybe better to use feedback nodes since your block diagram is HUGE - I'm guessing that you will have even more wires running through the map and making it more difficult to read the design.  Feedback node would stay local and it wouldn't require too many wires (in fact you have shown that in your diagram except that it is wired a little differently than what you're meaning to get out of it).

 

-DP

 

 

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 3 of 5
(2,221 Views)

@CRivett wrote:

Hi,

 

so I have only seen discussions on the idea exchange about this opic (at least that i could find), but not anything that is actually a work around. I would like to use the values from previous cases as they are being itterated through. I have a for loop that has 3 numerical cases (0,1,2) and in each case there is a large array that is capturing data being measured that is then being divided into sub arrays to be used later outside the case structure and loop. however, each time the structure itterates to the next case, the previous values are overwritten and are output as empty arrays. Is there anyway to make it so that the previous sub arrays from earlier cases are not overwritten? or any other work around that i could use? perhaps some kind of other default case? I've attached my code and there are pictures below that focus on the area i mean (it's messy i applogize i'm pretty new at this.)

 

 

Thank you very much,

 

any suggestions would be great. I've been stuck all day.


 

You have a pretty big mess (and some items can be done in a much smaller code - you're also repeating many things when you don't need to - for example when you get those references) but I have shown what you could do:

 

1. You can preserve each of your main arrays that is generated in your 3 iterations of your FOR loop... (attached is that modification to your vi)

2. Pull last section of your stacked structure out of your FOR loop (where you're splitting each subarray - which are becoming empty when you run FOR loop), and use unbundled elements from above step to split out arrays that you need in one shot.

 

If you didn't have such a large block diagram, I would have shown something more but in current case it would take way too long to clean up.

 

Hope that helps...

 

-DP

 

Untitled.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 4 of 5
(2,208 Views)

Hi BTC_admin,

 

Thank you very much for your responses. I was wondering if you could reattach your files as an earlier versions. I only have up to 2011. 

 

Thanks again!

0 Kudos
Message 5 of 5
(2,175 Views)