Discussion:
How do i create an array constant?
(too old to reply)
BrentSchenk
2008-07-18 19:10:07 UTC
Permalink
Hi,
 
i want my program to start off with a 1D array with values already assigned to the elements.  I cannot for the life of me figure out what to use to create this array and start out with the values that I want without creating another VI that would use the initialize array and then repeatedly use add element to array until i was finished.  if anyone knows a quick way to just have an array constant with values to start out with that would be great!
 
Brent
smercurio_fc
2008-07-18 19:10:09 UTC
Permalink
There is an array constant on the array palette. Place it on the block diagram and then place into it the datatype that you want. For example, if you want a numeric, select a numeric from the Numeric palette and place it inside the array container. To change the datatype of the numeric right-click on it and select "Representation", and then the appropriate numeric datatype. To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's <a href="http://zone.ni.com/devzone/cda/tut/p/id/5054" target="_blank">Learning Center</a> which provides links to other materials and other tutorials. You can also take the <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">online courses</a> for free.
GovBob
2008-07-18 19:40:07 UTC
Permalink
I'm not sure what version on LabView you are using but under programmiing&gt;&gt;array&gt;&gt; array constant. Place this on the block diagram. I will be a blank box.Now you need to define the type of array constant. Creat a string, numeric or boolean constant. Drag this inside the blank box. Expand it to show how many elements you need. Enter in the values you want.
&nbsp;This also works the same way on the front panel to create an array control.
BrentSchenk
2008-07-18 19:40:07 UTC
Permalink
Thank you very much, i cant believe that i couldnt figure that out on my own.&nbsp; I couldnt even find it in the reference book that i have LabView for everyone which has been really helpful in the past.
morgol
2008-07-18 19:40:09 UTC
Permalink
Also keep in mind that you can always convert a control to a constant. :) Right-click on the control on the block diagram.
Loading...