LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert into array and view output



@pecan204 wrote:
Thanks for the comment. I tried the repalce array subset and included a loop to experiment. Where the integer goes into the the component specifying the index is an error. But it seems to me that the integer i of a for loop should be a consistent data type for an array subset index?

I would highly suggest do to a few beginners tutorial to learn the differences and meanings between scalars, arrays, tunnels, shift registers and to learn how you can tell certain things from the thickness of wires, for example. ALso have a look at all the examples that ship with LabVIEW.

What you are trying to do makes little sense. Basically, you create a 4 element array that you want to substitute into an existing array of the same size. This will only make sense if the start index is zero, else you'll loose elements. Frankly, I am not quite sure what you really want.

Still you've been stumbling around with little knowledge and your VI can tell us about it. For example, you have placed a breakpoint (shown with the red outline around your diagram). Was that intentional? Also, your array indicator shows 4 elements (same as the data array), but you set the index to 3, meaning the first few elements will be hidden. (The index number determines which array element is shown in the upper left corner, the first element is #0).

Here's a quick rewrite (LabVIEW 7.1). You really only need to upper algorithm if you need to do arbitrary replacements in an existing array. To simply create a ramp its overkill. 😉

 

Message 11 of 12
(568 Views)

Thank you for the input Altenback,

I've been working with Labview on and off for a few months and learning certain areas. Now its arrays. To be honest, its painfull, But I have programmed alot in fortran, c, and java. Every time I attempt to make a change to vary a vi layout some thing goes wrong with few clues that I understand.

The breakpoint was a leftover from a change. I haven't figured out how to remove it checking every menu item and every L-R click. Is it me or LV. I like it to be obvious.

In this VI, I was attempting to set up an array and then replace certain elements with new numbers. The breakpoint and output indictors would verify that.

Looks like from your example I realy don't have to initialize the array with that component if I do it manually on the from panel?

Ken

 

 

0 Kudos
Message 12 of 12
(557 Views)