Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Array does Not resolve to a Fixed Size error

Solved!
Go to solution

Hey

 

I'm using the NI-9223 module. I want to be able to choose which inputs I want to acquire every time I run the VI. For that I used a lot of case structures, I tried on simulation and it functions. But when I tried to compile the code I got this error "Array Does Not Resolve to a Fixed Size".

 

I thought all of the arrays I used were with a fixed size, but now I'm not sure. Is this error occuring because for each case I have a different array wired to the output tunnel? 

 

And is this case structure the best solution to dinamically choose the inputs?

 

 

0 Kudos
Message 1 of 6
(1,012 Views)

You have different lengths of arrays going to the same output tunnel in different cases.  For instance, case 0 has an empty array while case 1 has a 1 element array.  Since the maximum length in the cases is 4, you need to make all of the output arrays a length of 4.  To help your FIFOs, you can also output the number of elements that need to be sent (wire to the N on the FOR loop).



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
0 Kudos
Message 2 of 6
(989 Views)

What do you mean "to help your FIFOs"?

0 Kudos
Message 3 of 6
(974 Views)

In my opinion, it is a waste of FPGA resources to have multiple relatively similar cases, with only one of them being active and the rest remaining idle most of the time.

 

I would program to write all 4 channels to the FIFO, then filter the data from selected channels on the host size.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 4 of 6
(968 Views)
Solution
Accepted by topic author euqinom2727

@ZYOng wrote:

In my opinion, it is a waste of FPGA resources to have multiple relatively similar cases, with only one of them being active and the rest remaining idle most of the time.

 

I would program to write all 4 channels to the FIFO, then filter the data from selected channels on the host size.


This is good advice.  The only difference I would do is wire up the N to the FOR loops that write to the FIFOs.  Doing this, the FPGA can limit what data goes up to the host.



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
0 Kudos
Message 5 of 6
(962 Views)

Thank you guys!

0 Kudos
Message 6 of 6
(918 Views)