LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an array as long as wanted?

Hello tst 🙂

Aaah so that is what we been doing :P. Alright... but we can not create a number of rows that we want directly to the number of rows? We tried to "create constant" and then wright for example 10... thank you for your help! Best regards.
0 Kudos
Message 21 of 22
(559 Views)
It appears you want to create an array with some parts active and some parts not active. This involves some low level tweaking, but can be done. Create a cluster with all the things you want in each array element (a boolean and a string, for example). Create an array with your cluster as the element. Make the array a control. On your block diagram, get a reference to the array element, coerce it to a cluster (since you know it is one), and get references to all controls in the cluster. Loop through all the controls and disable the ones you want to. I have attached an example of doing this.

The example VI is in run mode so you can see the effect of the operation. Select Operate->Change To Edit Mode from the menu to get back into edit mode. The example is written in LabVIEW 7.0.

If you want to see a more complex example in action, check out the channel control on the NI-SCOPE Soft Front Panel (included with the NI-SCOPE driver, free download, don't need hardware to run). It uses the same procedure.
Message 22 of 22
(488 Views)