2014년 10월 15일 수요일

[LabVIEW Example] Changing Array UI programmatically in LabVIEW

When you use Array control or indicator in LabVIEW, you want to change Array in FrontPanel programmatically. Array Control and Indicator is not changed basically if some values in Array is inserted or changed likes a below picture.

In this situation, you can check the first value, but you can not check other values in array directly. To see these value, you have to click a button or insert value to a user interface. 


Can we solve this problem in programming mode? Yes, we can. We can use a property node for it in LabVIEW.

First, Let's look at the code to generate an array in LabVIEW.



The code above repeats a for loop according to the value of NumberOfArray and generates an array filled with the corresponding i values. Running it with 5 in NumberOfArray basically will be seen as a picture below.


To solve this, you should use a property node called Number of Row. When you set the array's length to this property node, you can see the result as below. If you want to use a two dimension array, you have to set Number of Row and Number of Column.


Now, I am going to show the method to implement for it. To make this property, you just click a right button of your mouse on array in Block Diagram and  choose Number of Rows as below a picture.




And then you need to modify this code to set the value to this property. Then you can see the a right result in FrontPanel.

This article explained how to change the Array User Interface in programmatic.
Thanks.

댓글 없음:

댓글 쓰기