From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete row from build array?

Solved!
Go to solution

Delete Array.jpg 

I am trying to select whether to add new values to the array or clear the array, but I seem to have an error. The error is that the polymorphic terminal can not accept this data type.

 

Does anyone know what I might be doing incorrectly?

 

 

0 Kudos
Message 1 of 15
(3,332 Views)

You cannot select between an array and a scalar. They types must match. Maybe you could add the select after the "build array" node.

 

Overall, the code does not make a lot of sense. Can you explain what you are trying to do? I am sure there is a better way. A simple "built array" does NOT add an element to an existing array, for example.

0 Kudos
Message 2 of 15
(3,303 Views)

You do not show what is to the left of your picture. What is feeding into the select for the left?

The way you have run your wires we can not tell for sure what output you have wired to the feed back node

 

How to delete row.png

 

What is it you are trying to do??

Omar
0 Kudos
Message 3 of 15
(3,298 Views)

Are yo looking to delete one value or initilize the array to empty? I am a little confused as to what you are looking to do. I looks like the picture is looking to delete one value but in your description you said that you wanted to clear the array.

Tim
GHSP
0 Kudos
Message 4 of 15
(3,282 Views)

I've attached the VI in question. 

 

I'm looking to delete the whole array/clear the array/initialize the array after the timer hits a specified value (elapsed time). 

 

Bascially, my thought process was to build an array with data coming in for about 10 seconds, send those values to the mean function to be averaged, then clear the array so that new values can be averaged.

 

As far as I know, delete from array is one way to do it, but I guess I'm implementing it wrong or something.

0 Kudos
Message 5 of 15
(3,260 Views)

You array never has more than one element. I am sure you want to build the array in a shift register or feedbasck node instead.

 

 

Why are you throwing away most elelemts of the original Y array?

 

 

0 Kudos
Message 6 of 15
(3,248 Views)
Solution
Accepted by topic author msiwk

THere is a built in function that already does that called point by point mean. It is on the tool palete. You can tell it how many points to average while they come in one at a time.

Tim
GHSP
0 Kudos
Message 7 of 15
(3,238 Views)

 


 

Why are you throwing away most elelemts of the original Y array?

 


 

 I don't want to average any old values after the timer resets. Only the new ones.

0 Kudos
Message 8 of 15
(3,229 Views)

 

 

THere is a built in function that already does that called point by point mean. It is on the tool palete. You can tell it how many points to average while they come in one at a time.

 


 

 

Can the point by point mean ignore old values and only average the last few data values?

0 Kudos
Message 9 of 15
(3,226 Views)

@msiwk wrote:

 


 

Why are you throwing away most elelemts of the original Y array?

 


 

 I don't want to average any old values after the timer resets. Only the new ones.


I am not talking about the averaging. With every call, you get a Y array, but you only decide to use the first element. Why?

0 Kudos
Message 10 of 15
(3,221 Views)