02-02-2016 04:35 AM
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
Solved! Go to Solution.
02-02-2016 06:14 PM
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:
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
02-03-2016 11:00 AM
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
02-04-2016 02:48 AM
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
02-04-2016 02:05 PM
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:
Regards,