キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Creating an array from a number indicator display

解決済み
解決策を見る

Hello, I am super new with LabVIEW programming and I am stucking with this problem for a couple of days.

 

I programmed an interface that shows two displays with real time measurements of V (the same that the actual instrument has). I represent these measurements with a waveform chart without any problem.

 

After that, my idea was to take the measurements showed in the display in an array, until a botton is pressed. Then, these numbers are averaged with the loop interaction number.

 

My problem is that only the first box of the array refreshes, and I cannot get more than 1 measurement for averaging it. A have seen a couple of people IV's where they set the array to a 2D one and it takes the measures until stopped, but if I set the dimensions of my array to 2 I have an error in the wire between the build array function and the voltage array.

 

Thank you in advance for your time and attention

0 件の賞賛
メッセージ1/4
2,859件の閲覧回数

I recommend that you go through the training material at the top of this forum. You are making an array on every iteration of the loop that contains only 1 element. You need to use a shift register to retain the values. Also, there is a Mean primitive available in the Probability and Statistics pallette.

0 件の賞賛
メッセージ2/4
2,836件の閲覧回数
解決策
受理者 DFMarq

@johntrich1971 wrote:

I recommend that you go through the training material at the top of this forum. You are making an array on every iteration of the loop that contains only 1 element. You need to use a shift register to retain the values. Also, there is a Mean primitive available in the Probability and Statistics pallette.


Not quite john!.... Do get rid of the build array inside the loop.  Then right-click the output tunnel and select Tunnel Mode>>Indexing.  Dead on about the use of Mean.vi though

 

Also, there is no reason to have a wait in the while loop.  The VISA Read will pace the loop just fine.


"Should be" isn't "Is" -Jay
0 件の賞賛
メッセージ3/4
2,826件の閲覧回数

@JÞB wrote:

@johntrich1971 wrote:

I recommend that you go through the training material at the top of this forum. You are making an array on every iteration of the loop that contains only 1 element. You need to use a shift register to retain the values. Also, there is a Mean primitive available in the Probability and Statistics pallette.


Not quite john!.... Do get rid of the build array inside the loop.  Then right-click the output tunnel and select Tunnel Mode>>Indexing.  Dead on about the use of Mean.vi though

 

Also, there is no reason to have a wait in the while loop.  The VISA Read will pace the loop just fine.


Agreed. I had assumed that there was going to need to be some additional logic to only take specific readings based on a misreading of the OPs post (plus I cringe at the idea of building an array in a while loop uncontrolled anyway).

0 件の賞賛
メッセージ4/4
2,821件の閲覧回数