LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to delete selected arrays from a data set during runtime?

Hi everyone...

 

I am developing an offline data analysis vi and have hit a small speedhump... I have attached a ppt of my front panel with a description...

 

Basically, I plot my dataset and extract x number of arrays that contain the data of interest... These arrays are averaged and the mean used to perform my calculations... However, there is likely to be times when 1 or more of the arrays are dogdy and need to be deleted so they do not contribute to the mean or the calculations... The number of arrays may be different from file to file... What is the best way to delete selected arrays? My problem is the the number of arrays in the dataset will change from file to file... If there was a fixed number of arrays I'd just use a button or boolean for each array; but as I cannot chnage the numbe rof radio buttons or booleans during runtime I'm not sure how to proceed?

 

Any suggestions would be greatly appreciated.

 

Regards,

Jack

0 Kudos
Message 1 of 8
(2,990 Views)

this might help you....

delete array.png

0 Kudos
Message 2 of 8
(2,973 Views)

@jcannon wrote:

I have attached a ppt of my front panel with a description...


Don't attach a PPT of a front panel. That is completely useless. Please attach a simplified version of your VI.


@jcannon wrote:

Basically, I plot my dataset and extract x number of arrays that contain the data of interest... These arrays are averaged and the mean used to perform my calculations... However, there is likely to be times when 1 or more of the arrays are dogdy and need to be deleted so they do not contribute to the mean or the calculations... The number of arrays may be different from file to file... What is the best way to delete selected arrays? My problem is the the number of arrays in the dataset will change from file to file... If there was a fixed number of arrays I'd just use a button or boolean for each array; but as I cannot chnage the numbe rof radio buttons or booleans during runtime I'm not sure how to proceed?


Your description is very unclear. Please explain what your data looks like. What are your "arrays"? How many dimensions do they have?

Are these rows or columns of a 2D array? cluster elements containing arrays, or whatever?

What is the definition of "dodgy"? Does the user pick those or do you have code to detect "dodginess"? 😄

 


@apok wrote:

this might help you....


 Your code does not answer the question at all and just confuses. Your code only has one array, but the question talks about arrays. Your use of "equal FALSE" is just plain silly. This is equivalent to a "NOT", you can leave it out completely and swap the inputs to the select function to get the same effect. In general it is poor UI programming of you dynamically resize array containers. What if there are millions of elements? What if there are other front panel object in the grow space?

 

0 Kudos
Message 3 of 8
(2,956 Views)

@altenbach wrote:

@jcannon wrote:

I have attached a ppt of my front panel with a description...


Don't attach a PPT of a front panel. That is completely useless. Please attach a simplified version of your VI.


@jcannon wrote:

Basically, I plot my dataset and extract x number of arrays that contain the data of interest... These arrays are averaged and the mean used to perform my calculations... However, there is likely to be times when 1 or more of the arrays are dogdy and need to be deleted so they do not contribute to the mean or the calculations... The number of arrays may be different from file to file... What is the best way to delete selected arrays? My problem is the the number of arrays in the dataset will change from file to file... If there was a fixed number of arrays I'd just use a button or boolean for each array; but as I cannot chnage the numbe rof radio buttons or booleans during runtime I'm not sure how to proceed?


Your description is very unclear. Please explain what your data looks like. What are your "arrays"? How many dimensions do they have?

Are these rows or columns of a 2D array? cluster elements containing arrays, or whatever?

What is the definition of "dodgy"? Does the user pick those or do you have code to detect "dodginess"? 😄

 


@apok wrote:

this might help you....


 Your code does not answer the question at all and just confuses. Your code only has one array, but the question talks about arrays. Your use of "equal FALSE" is just plain silly. This is equivalent to a "NOT", you can leave it out completely and swap the inputs to the select function to get the same effect. In general it is poor UI programming of you dynamically resize array containers. What if there are millions of elements? What if there are other front panel object in the grow space?

 


this code adresses the number of arrays he is computing and generating boolean controls to delete the arrays...your tone is demeaning when all I offered is to help others move forward with the right motive. and the vi is not about the "millions of elements" when we are talking about #'s arrays here.

0 Kudos
Message 4 of 8
(2,954 Views)

@apok wrote:
...your tone is demeaning when all I offered is to help others move forward with the right motive. and the vi is not about the "millions of elements" when we are talking about #'s arrays here.

Sorry if I offended you, nothing personal. I was just pointing out some things that bothered me with your answer. You are free to disagree with my assessment. 🙂

 

(Next time please quote only relevant sections of a post, not the entire thing. Way too much duplicate information cluttering up the forum. ;))

0 Kudos
Message 5 of 8
(2,922 Views)

Hi altenbach,

 

Thanks for the reply... I included the front panel image to more clearly describe the vi functionality I was seeking... I appreciate it provides nothing regarding the code, but I had no code related to that function at the time (hence my post seeking assistance).

 

Yes, my message could have been clearer regarding my "arrays"... I will provide more detail in future postings... I have provided some code in my repy to apok; if you are interested in following. That code is likely not very efficient; but I am not an EE (I am a Exercise Physiologist) and as such my LV skills are developing... And constructive feedback is always welcomed.

 

Regards,

Jack

0 Kudos
Message 6 of 8
(2,884 Views)

Hi apok,

 

Many thanks for your reply and the code you provided... I had a play with it and it works well; see attached.

 

This works very well for my purpose... My dataset is a 2D array that may include anything from 2-8 rows of data (which are independent strain signals) each aout 4000 elements in size at most (all arrays are equal in size); so the dataset is not huge or memory expensive... I embedded your code in a while loop where;

 

1. Number of buttons visable changes based on the number of rows in the 2D array;

2) I can manually select which rows of data I want to keep (and that contribute to the mean signal that is used for analysis) based on a visual inspection of the graphed data;

3) The mean signal is then calculated from the rows that are kept;

4) Then all the rows that are kept plus the mean of the rows (i.e. mean strain-time curve) are plotted for comparison.

 

All works in real-time and I can select/unselect strain signals and see the graph update instaneously... Awesome! Just want I wanted.

 

Now, if only I could have different labels on each of the boolean buttons that reflect the strain signal that it is assigned too (i.e. "Strain Sig 1" instead of "In/Out", etc)... But I pretty sure that cannot be done.

 

Again, many thanks... Your assistance is very much appreciated.

 

Regards,

Jack

 

PS.... Is there an easy way to paste block diagram info to my postings? I usually do a screen capture; surely there is a much similar method?

 

 

0 Kudos
Message 7 of 8
(2,880 Views)

@jcannon wrote:

PS.... Is there an easy way to paste block diagram info to my postings? I usually do a screen capture; surely there is a much similar method?


Select all your code, then do a "menu...edit...create VI snippet from selection".

 

We can even later take that image and drag it to the block diagram of a new VI and it will turn back into runnable code. 😄

 

I'll look at you code later.....

0 Kudos
Message 8 of 8
(2,867 Views)