Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

array fixed size error

Hello all,

I am new to LabVIEW and I am currently facing an issue regarding a compilation error. My board is USB 7856 EOM.

I am attaching an image of my code, the shift register here seems to be the issue as the error says "array does not resolve to a fixed size".

I am trying to send an array of data to my FIFO and basically send a set of points in the form of arrays, and once the array is filled, reinitialize/empty the array and fill it with the new set of points again. I have attached my VI as well which I will be using to do a frequency Sweep. Any suggestions would be appreciated.

 

Thanks in advance

Download All
0 Kudos
Message 1 of 4
(149 Views)

Inside of the FGPA, the size of an array has to be fixed in size because you are defining hardware.  The solution here is actually fairly simple.  You only need 1 loop.  In this loop, you read the analog input and wire it straight to the Write FIFO.  This will continuously write your analog input to the FIFO.  There is no need to mess with an array at all.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(127 Views)

@ardanvarya wrote:

 

I am trying to send an array of data to my FIFO and basically send a set of points in the form of arrays, and once the array is filled, reinitialize/empty the array and fill it with the new set of points again. I have attached my VI as well which I will be using to do a frequency Sweep. Any suggestions would be appreciated.

 

Thanks in advance


On a side note, even on plain labVIEW (where arrays don't need to be fixed size!) your code makes absolutely no sense. 

 

  • Prepending (instead of appending) to an array is always harder on the memory manager.
  • That array-to-cluster-to-array dance is just plain silly (I also can't tell the cluster size setting from the picture)
  • Your inner loop has a guaranteed fixed number of iterations known before it even starts so it is just a glorified FOR loop).
  • Your first loop stack will just repeat the same operation as fast as the hardware allows until "stop 2" turns true (I am sure there could be a more reasonable label for that control)
  • Your last loop must wait until "stop 2" is pressed, at which time it will go over all elements of the input array and continue forever as fast as it can, even if there is no valid data because the input array has run out of elements. It will only stop if "stop" turns true.

I strongly recommend to work out some reasonable logic in plain desktop LabVIEW and get familiar with the basics of dataflow before even attempting to involve FPGA. An FPGA has no real UI and always runs so having consecutive interactive loops seems off in any case.

Message 3 of 4
(112 Views)

Hey,

Thanks for the advice. Instead of doing multiple things simultaneously, I tried to do just the signal generation first.

I am attaching a screenshot of my signal as shown in the oscilloscope, I cannot figure out why it is so distorted, is there an issue with the Loop timing or update rate?.

The graph looks OK when I simulate it but the analog signal display on my oscilloscope is seen in the attached image and there is some error. 
PS I did this based on the "data processing" example found in the LabVIEW example finder, I retained the "Number to boolean" and "boolean to number" conversion as it was in the example. Is that itself the issue or there is a flaw in my logic?

Download All
0 Kudos
Message 4 of 4
(78 Views)