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: 

array constant

Hi all,

I'm trying to determine the most feasible way of using an array constant in a lookup table manner. The array can be calculated based on the element indices (it is a modification of the Hilbert Transform). This array can be any size (but must be square).

 

There are two ways I can do this; 1) insert an array constant with a large number of elements ~4000x4000 (would be largest needed) and get the subset required for my transform or 2) determine the array size and generate the elements in a mathscript or other method. A 4000x4000 array is currently taking about 800 milliseconds to generate.

 

I am wondering which is most efficient, does a large constant array take up much of the available resources? I would most likely do a combination of the above whereby if the number of elements in the constant is not enough I'd generate the missing ones.

 

Another query and is probably very simple and basic, but if I start with a small array constant and then generate a larger one can I make this larger array the initial constant the next time the vi is called?

 

Regards,

 

Leeser

0 Kudos
Message 1 of 3
(2,605 Views)
Do you really need an array constant for this? I mean have you considered storing the required information (the 4000 x 4000 matrix) in a csv file, or an xml or a simple txt file or binary file?
0 Kudos
Message 2 of 3
(2,578 Views)

Leeser wrote:

Another query and is probably very simple and basic, but if I start with a small array constant and then generate a larger one can I make this larger array the initial constant the next time the vi is called?


You would keep the array in an uninitialized shift register or feedback node and update it only if the input change and once at the start of the program. A 4000x4000 array of DBL is very large and needs contiguous memory. You need to code carefully to avoid extra data copies and resizing operations.

Message 3 of 3
(2,567 Views)