LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to insert element into array without changing size

Yes, I am thinking of doing this as well. I am planning to "shift" the elements down the array at the insertion point before I insert the element. But I am getting stuck on how this could be implemented in LabView FPGA. Thanks!

0 Kudos
Message 11 of 18
(1,530 Views)

It is certainly possible to do this in the FPGA. We will need to know a few more details about the application to be able to come up with the most efficient way to handle it, but the way I have solved a problem similar to this in the past is the following ...

 

You generate the N symbols up front into a random-access memory, FIFO, or whatever is most efficient. You then calculate the pilot symbols and store them in a smaller memory off to the side. When you stream the actual signal out to the I/O or to some other device, you have a little counter / state machine that counts and inserts the pilot symbols into the stream at the correct points. You never actually have to insert them into the array. This works assuming the insertion of the pilot signals is the last thing you do.

0 Kudos
Message 12 of 18
(1,503 Views)

There are some tools in the palettes of LabVIEW FPGA that are no compatible. For example, the double precision numbers, the variable size arrays, XY Graphs, amongst others. The question is why does LabVIEW keep them in the palettes if you cannot use them because of the hardware restrictions?

In the case of Insert into Array functional block, if you have two fixed-size arrays as inputs, i.e. the original array and the array that will be inserted in the original, then why the output array is variable? I think LabVIEW should realize or assume that the output will be fixed and won't change in the time unless that block is placed in a loop and each loop iteration makes its size change. I think its use should be restricted only for outside a loop or if it is executed once.

What do you think?

0 Kudos
Message 13 of 18
(1,468 Views)

If you are working in the FPGA context (you opened the VI from within an FPGA Target in the project), the palette should only include things that will in some scenario work on the FPGA. For instance, some nodes may drop with double precision terminals but if you wire or configure them correctly they will adapt to something the FPGA compiler can handle. In your specific case, wiring fixed size arrays to the insert in such a way the compiler can guarantee a fixed-size output should work. There might be cases such as wiring a variable value to the index terminal that make it impossible for the compiler to determine a single size for the output. Those are the cases that break.

0 Kudos
Message 14 of 18
(1,454 Views)

Sure, but that is not the case. The Insert into Array VI does not work! That is why I think this function should not be included in the module. Another case when the Build Array VI is used, why does not the compiler have this same problem if both functions work similar? (Of course the Insert into Array VI concatenates in a specific index)

0 Kudos
Message 15 of 18
(1,444 Views)

As a side note, I don't know what version of LabVIEW you are using, but floating point numbers are supported in the 2012 FPGA module, so floating point functions appearing on the pallete is not a bug.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 16 of 18
(1,434 Views)

@vitrion wrote:

Sure, but that is not the case. The Insert into Array VI does not work! That is why I think this function should not be included in the module. Another case when the Build Array VI is used, why does not the compiler have this same problem if both functions work similar? (Of course the Insert into Array VI concatenates in a specific index)


Does the Insert into Array not work as you expected it to? Here is a simple example that works on the FPGA.

 

insert into array.png

 

Again, the types must be resolvable to fixed-sizes at compile time (which is the case in this example).

0 Kudos
Message 17 of 18
(1,394 Views)

Thanks. I just understood the problem. You cannot use controls for indexing. Index must be constant because after the compilation the index cannot determine the position where the new sub-array is going to be inserted. I could not do it in line only by breking up the source array in VHDL. It would require a shift register.

Some other functions are similar, the index must be constant unless you want to address the array and use an element of it.

0 Kudos
Message 18 of 18
(1,378 Views)