LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Max/min of data incoming in real time

Hey there! 

I've created an intensity graph whose Z-axis color scale max and min values are programmed to be the same as the max and min values in a data set, which is coming into a 2D array in real time from an instrument. 

My VI works, but seems to only update the max and min once, and is not continually updating them in real time as the data changes. 

My question has to do with the nature of the Array Max/Min function. Do I need to place the max/min array function in a loop for the VI to continually search the data set for max/mins in real time as new data comes in? Or should it already be comparing all values in the array as it grows, and I have not correctly identified the problem?

Thank you so much for your help.

0 Kudos
Message 1 of 5
(3,214 Views)

Here's a screenshot of the VI

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

Hi abj,

 

ArrayMinMax gives you the min/max of the values in your array.

What else do you need?

 

Maybe you want to "remember" min/max of previous iterations of your loop: use shift registers to store values!

 

Just saw your screenshot: there is no loop in your VI (visible). Your VI will not run "in realtime" as it automatically stops after executing all content once. You don't use this "Run continuously" button, don't you?

 

Btw. it's bad coding style to have terminals in your block diagram without label! It's also bad coding style to implement race conditions! Using AutoCleanup from time to time would improve your VI also… 😄

Best regards,
GerdW


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

Thanks for your tips GerdW! I'm a very new labview user. I'll try out your suggestions

0 Kudos
Message 4 of 5
(3,200 Views)

Your VI is full of race conditions because there is not defined order of operations for all the disconnected code fragments. So first fix your code.

 

For similar problems, there is also Array Max & Min PtByPt VI

 

0 Kudos
Message 5 of 5
(3,194 Views)