LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clusters- Dodgy initialisation of arrays

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.

0 Kudos
Message 1 of 7
(3,387 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 7
(3,378 Views)

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

0 Kudos
Message 3 of 7
(3,377 Views)

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.

 

0 Kudos
Message 4 of 7
(3,370 Views)

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

Message Edited by Jaspal on 10-02-2009 10:18 AM
Message Edited by Jaspal on 10-02-2009 10:18 AM
0 Kudos
Message 5 of 7
(3,368 Views)

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

0 Kudos
Message 6 of 7
(3,365 Views)

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

0 Kudos
Message 7 of 7
(3,341 Views)