05-05-2010 12:27 PM
In the attached VI I don't understand why data from the inner case structures are not being transmitted to the array.
Thank you.
Solved! Go to Solution.
05-05-2010 12:52 PM
Watch the code in execution highlighting and use probes on the cluster coming into the while loop and what is being passed out. What I believe you will find is that only the last iteration of teh while loop has an effect since the revious iteration results are toessed on subsequent iteartions.
So...
Right-click on the tunnel bring the cluster into the while loop and select "Replace with Shift Register" and finsh that off by clicking the output tunnel of the cluster.
The SR will maintain the results from earlier iterations and build on that for latter iterations.
Ben
05-05-2010 01:03 PM
Ben,
I tried that with no success. Possibly I didn't understand your suggestion.
See attachment.
Thank you.
05-05-2010 01:10 PM
05-05-2010 01:17 PM
05-05-2010 01:24 PM - edited 05-05-2010 01:31 PM
It took me some time to figure what you are trying to do but I think I have it now.
The SR is still required.
What is happening is your "Bundle By Name" is replacing all of the fields of the cluster, not just the value coming out of the case structure. So to maintain the cluster stuff you do in earlier iterations you can either...
1) Put the "Index array, Bundle by name, and Replace array" inside the case structure and ONLY bundle the value you are setting in that iteration. (as you will see Tim post shortly)
OR
2) Move the Index array before the Case, unbundle all of the fields and feed teh case structure and run them across the case so that ALL of your output tunnels come from the coresponding input tunnel EXCEPT for the filed you are trying to set.
Ben
05-05-2010 01:26 PM
chuck72352 wrote:
I've converted the VI to 8.6. I'm not sure exactly what you mean.
Well, I still can't run it, the typedef is missing.
Anyway, what I mean is that on every iteration of the while loop you are bundling every value in the cluster. However, only one of these values is getting real data (the data that comes from the while loop). All of the other values are getting the default data for that type. You can tell because of the tiny white square inside the tunnel.
In addition to adding the shift register like Ben suggested consider doing this, but of course with the proper bundle in each case.
05-05-2010 01:57 PM
I've detached the type defs.
I tried you suggestion, but I'm still doing something wrong.
See attached.
05-05-2010 02:01 PM
The VI still needs InfoCluster.ctl.
If you don't bundle anything into the cluster, you still have to pass the cluster through. You're running into the same 'Use Default if Unwired' issue as before. The presence of these 'bundleless cases' begs the question why you have those states since they don't do anything.
05-05-2010 02:07 PM
Those little white dots on your output tunnels are there to get your attention.
Everytime your code uses a case that is not wired thru teh default data is used.
Wire thru the cluster.
In general I avoid using the "Use default if unwired" (exception is stop button in event structure) because if this behaviour. I would rather have LV bitch at me about an un-wired tunnel than have to debug to find out I forgot about the new case i just added.
Hint: Execution highlighting should have helped.
Ben