LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array and cluster compatibility problem

the problem seems to simple but i can't fix it. this vi is suppose to allow user to basically remove data from an array if remove is selected, else cancel nothing happens. it "works" as i took the original code from another vi that someone at my company made but then vi i'm trying to use it in is a little different

as seen from help1, it is wanting an array of clusters. i did that in help2 but then it messes everything else up. i've tried multiple combinations of bundling, cluster to array, array to cluster, build array, build cluster array, and can't fix it
Download All
0 Kudos
Message 1 of 15
(4,402 Views)

you are trying to wire a cluster to an array. The pink wires are misleading because they are of different types.

The "Array" local variable is of type:  1-D string array

The cluster is of type: cluster of { 1-D string array, double, boolean}

therefore you can't wire them together..

The problem is in the "Remove: Value Change"

Are you trying to replace / remove / add an element in the string array?  and then put it back to the cluster?  and into the array of clusters?

Message Edited by JoeLabView on 07-03-2007 01:30 PM

0 Kudos
Message 2 of 15
(4,387 Views)

Looking at the images, it looks as though you want to remove an element from the array that goes into the cluster..

Before suggesting something, I need to understand what you are actually trying to do...  why do you have a FOR Loop and verify if the boolean is FALSE, then add element(s) to the array..  Does the feature remove multiple entries at once or do you treat each selection as a single item...  (I'm asking because <maybe> there is a more efficient way to implement the solution).

Why this? (see attached image):

 

Message Edited by JoeLabView on 07-03-2007 01:41 PM

0 Kudos
Message 3 of 15
(4,388 Views)
attached is a picture of my front panel. the boolean is the red box, the array is the next 5 blank columns, and the double is the last green column. this is only a subvi but what the entire program is suppose to do is grab data and anaylze it. i have no problem grabbing and no problem analyzing, but i want to first "filter" the data. what i am trying to achieve here is that when boolean is true (to answer your question) is to delete/exclude that row from being analyzed (so ignore the corresponding array and double, ignore the entire row)
0 Kudos
Message 4 of 15
(4,372 Views)

the short answer to your question (purely as educational purpose) is to recombine the cluster and insert into the cluster-array... 

However, it is bad advice because I would need to know why you are modifying the string array inside an array of clusters..  In other worlds, for each cluster element, everytime you have a FLASE boolean, you append that the string array to the string array of the next cluster element whose boolean value is FALSE..  That's a growing array... but the first time it is called, you write back the same string array..

I only had one coffee today.. maybe I'm missing something... 😉

YES::  Now the array of clusters is NOT the same as the original one... 

It is of type: {array of strings, array of boolean, array of double} 

original type: { array of strings, double, boolean}

But you are trying to wire a regular cluster (not array) to the Array local variable.  Now what does that "Array" local variable look like? 

 

EDIT STARTS HERE:

I just saw your reply..

"what i am trying to achieve here is that when boolean is true (to answer your question) is to delete/exclude that row from being analyzed (so ignore the corresponding array and double, ignore the entire row)"

let me see if I understood... I'll post another diagram...

 

Message Edited by JoeLabView on 07-03-2007 02:01 PM

0 Kudos
Message 5 of 15
(4,364 Views)

see diagram below:

It clears the string array for every cluster element where the boolean is set to FALSE.. 

in the true case, you could wire the cluster tunnels directly together (in & out). But is only clears the string array... does not do anything to the double..

 

Message Edited by JoeLabView on 07-03-2007 02:08 PM

0 Kudos
Message 6 of 15
(4,358 Views)

The better way would be to index the element of the cluster whose values you want to remove.  This may eliminate the need for the loop.

Sp the image you provided (below) is actually the Array which you are wiring to (local variable).. is that right?  You want to maintain the same size of array, but if the boolean (left) is set to FALSE, it clears the 5 boxes in the middle. The double to the right remians unaffected..

Now is it okay to clear those 5 boxes of string? There may be other ways of providing a solution without clearing any data, etc...

Message Edited by JoeLabView on 07-03-2007 02:19 PM

0 Kudos
Message 7 of 15
(4,353 Views)
ok it has no errors now, but doesn't work the way i wanted so i am not sure what the problem is. i will work on it a bit and update post later. thanks

//EDIT: just read your reply. yes the image i provided is the local variable array. about maintainig the same size of the array, the amount of the data that is grabbed from our database varies from 0-couple hundred, so i am not sure how that would help. i think it's fine if it clears the 5 boxes, but again right now it is not working properly so that is something i have to look into

Message Edited by unknown00 on 07-03-2007 01:34 PM

0 Kudos
Message 8 of 15
(4,347 Views)
ugh still doesn't work. biggest problem though is when i say "remove" it doesn't remove just one array or just one row but instead removes everything
0 Kudos
Message 9 of 15
(4,327 Views)
i found the problem but i don't know how to fix it. if you look at my previous pictures the user is suppose to be able to set the boolean, but the boolean value does not change. i don't know why. if you look at my earlier pictures on the top left that is where the boolean is initialized. it won't change it's value after that...that's the problem 😞

Message Edited by unknown00 on 07-03-2007 04:23 PM

0 Kudos
Message 10 of 15
(4,320 Views)