LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an array from a number indicator display

Solved!
Go to solution

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 Kudos
Message 1 of 4
(2,543 Views)

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 Kudos
Message 2 of 4
(2,520 Views)
Solution
Accepted by topic author 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 Kudos
Message 3 of 4
(2,510 Views)

@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 Kudos
Message 4 of 4
(2,505 Views)