LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Main VI array values does not match Sub VIs'

Solved!
Go to solution

Hello. I have a problem i have been working on for a few days now. Trying different things and browsing internet has led me nowhere, so i hope this forum post can give me some answers.

 

I have a LabView program that will gather data from a DVM and analyse it in different ways. The DVM is measuring pulses from a power converter. The user can choose to measure several pulses. At one point it will pass the array of data into a sub VI that will find different data points (like max, min, peak to peak etc.) If several pulses are being measured, the sub VI will find these data points of each of the pulses, and graph them in a graph. Example: Measuring three pulses, and selecting 'Max' and 'Min' will result in graphing three Max data points and three Min data points. The problem i am having is that the values that is outputted from the Sub VI and graphed in the Main VI does not match the resolution of the graph in the Sub VI. These two graphs have identical settings in terms of display format, and everything else. When the Sub VI is done, it outputs three different values (in the example above of 3 pulses) to an array, and these are plotted in a graph. When these values are outputted to the main VI, all three values are the same. 

 

I will not post the main VI here, as it is huge, but as you can see in the screenshot attached, i basically feed the array to the Sub VI, along with a cluster where the user ticks off boolean boxes of what data points they want to graph. The other screenshots shows the comparison between the main graph and the Sub VI graph. I have also tried to output the array of data points, and look at the raw numbers, but in the main VI all three data points are identical. And yes, the refnum is fed into the sub VI, so the graph actually updates with different measurements, but all the data point values remain identical. 

 

Thanks for any help! 

0 Kudos
Message 1 of 5
(2,803 Views)

Hi Sontun,

 

as you can see in the screenshot attached, i basically feed the array to the Sub VI, along with a cluster where…

No, you don't!

There is NO array wired to your subVI. There is just a reference of a waveform graph wired to your subVI - and there is a big red coercion dot!

 

What happens when you really wire an array to your subVI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,791 Views)

Here is the part of the main block diagram i cut out in the last screenshot. The array variable 'Raw Data DVM1' contains the data. 

0 Kudos
Message 3 of 5
(2,770 Views)

Hi Sontun,

 

sorry, I mixed up this array wire with the graph refnum because you were showing only images of the graphs…

 

On your local variable: the data of this variable is getting used with different calculations (multiply, divide, scale by 1e6!) and is wired through some case structures.

Did you try to debug your VI?

Did you check the data in the wire directly before your subVI using a probe or indicator?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,755 Views)
Solution
Accepted by topic author Sontun

Hi.

By using Highlight execution i noticed that the graph actually updates itself in the Sub VI to match the one in the main VI, but because i am using the same sub VI later in the program, it updates to new values...

I found the problem to be that i delete the last portion of the array, but keep doing the analysis (min, max etc.) on the first portion of the array. This way, the analysis is done on the same array portion each iteration of the loop.

 

Thank you for your time!

 

Cheers

Message 5 of 5
(2,746 Views)