From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-03-2019 05:49 AM
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
Solved! Go to Solution.
10-03-2019 06:54 AM
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.
10-03-2019 07:11 AM - edited 10-03-2019 07:13 AM
@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.
10-03-2019 07:19 AM
@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).