10-02-2009 10:03 AM
Hi,
I have intialised some arrays as constants and added them to a cluster in a while loop. I am getting some pretty unexpected array writes in some su BI;s particularly the problem that whe iserting element into an array, only the first index is rewritten regardless of array initialisation. I cannot fill the heart rate array.
I suppose its to do with the way I have arranged the arrays/clusters.
I ahve spent half a day but to no good. Can somebody point out some major/minor flaws please.
10-02-2009 10:08 AM
Most of those Shift Regsiters appear be init with empty arrays.
Suggestion:
Watch your code in execution highlight mode (light bulb on). When array move around they will show the # of elements in them. Watch your code to see if you have the data you think you have going whereever.
Ben
10-02-2009 10:08 AM
2 of your array constants are not empty (heart rate is among them). And on empty array constant would be enough (saves screen real estate).
The problem with inserting is somewhere in the subVIs, I guess, so please post a shot of these.
Felix
10-02-2009 10:14 AM
Thanks ben and felix.
Here is the part where the I cannot manage to add the heart rate calculation to the arrays. I have tried insert into array and replace array subset and used different arrays to test these.
10-02-2009 10:18 AM - edited 10-02-2009 10:18 AM
The code works if I wire the array wire across individually instead of including it in the array, unbundling it, bundling it and then saving it to spreadsheet.
This made me think that it was something to do with the clusters
10-02-2009 10:18 AM
I can’t read what you did; a pasta dish comes to mind. Use one type cluster in to 1 shift register. After that your problem should be solved easily, if not someone else can follow you code to help
Good luck
Dan
10-02-2009 10:30 AM
If you insert in the empty array, it wont work. You could use append array instead. Or you intialize your arrays (for example with NaN) in the approriate size.
Felix