LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i create an array constant?

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
0 Kudos
Message 1 of 5
(8,263 Views)
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 Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
0 Kudos
Message 2 of 5
(8,255 Views)

I'm not sure what version on LabView you are using but under programmiing>>array>> 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.

 This also works the same way on the front panel to create an array control.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 3 of 5
(8,252 Views)
Thank you very much, i cant believe that i couldnt figure that out on my own.  I couldnt even find it in the reference book that i have LabView for everyone which has been really helpful in the past.
0 Kudos
Message 4 of 5
(8,247 Views)
Also keep in mind that you can always convert a control to a constant. 🙂 Right-click on the control on the block diagram.
____
Ryan R.
R&D
0 Kudos
Message 5 of 5
(8,237 Views)