LabVIEW Communications System Design Suite

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize 1D array with prespecified values

Solved!
Go to solution

Hi all,

 

I am pretty new to the comm suite, but I'm having a (probably rather simple) question about initializing an 1D array constant. Let's assume that I want to create an 1D array constant of size M and that I want to initialize it with certain prespecified values. Is there an easy/efficient way to do this? Initializing it one by one is rather cumbersome, especially for large M. Also, how can I initialize such a constant on an FPGA Traget?

I have seen that e.g. for multirate VIs it is possible to define a stream constant and initilize it with a .cvs file. Is there a similar possibility for initializing a 1D array constant?

 

Cheers,

 

steve0

0 Kudos
Message 1 of 5
(5,287 Views)
Solution
Accepted by topic author steve0

Hi Steve0,

 

I've found a quick and dirty workaround for this, as there is not a clear method to implement an arbitrarily large array constant. You can generate an array however you'd prefer, my example is seen below:

 

LabVIEW Comms Array.png

 

And then go to the Front Panel, right click on the indicator, and select "Capture Data". From there, that array will be available on your Data panel to drop as a constant to other VI's in that project. You can also do the same with a CSV file, by writing your CSV file to an indicator, and then capturing the data to use.

 

BeenCoughin

0 Kudos
Message 2 of 5
(5,259 Views)
Solution
Accepted by topic author steve0

steve0,

 

As BeenCoughlin mentioned, the best way to do this is to write a VI that reads your CSV file and populates an indicator. You can then convert that indicator to a constant, or use the capture mechanism to store that data in the data window (and then drop it as a constant).

 

In the next version we are planning to support importing the data from directly from a CSV file into the data window.

 

Gerardo

Message 3 of 5
(5,241 Views)

Hey BeenCoughin and GerardoG,

 

thank you very very much for your suggestions! For the solution I took the suggestion to write an VI that reads a CSV/TXT file and poplutes an indictor. Then I use captue and drop it as a constant. It works allthough changing the values of the vector would still need a manual manipulation of the constant. The possibility of dirctly importing data from a CSV file into a data window thus would really come in quite handy. Do you know when the new version is planned to be released?

 

Cheers,

 

steve0

0 Kudos
Message 4 of 5
(5,221 Views)

Hello Steve,

 

I am sorry. We can't announce any information with regards to the release, but as soon as it goes live look for a post like this:

http://forums.ni.com/t5/LabVIEW-Communications-System/LabVIEW-Communications-1-1-is-LIVE/td-p/319358...

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 5 of 5
(5,196 Views)