06-21-2017 09:33 AM
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.
06-21-2017 09:39 AM
Here's a screenshot of the VI
06-21-2017 09:40 AM - edited 06-21-2017 09:45 AM
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… 😄
06-21-2017 09:47 AM
Thanks for your tips GerdW! I'm a very new labview user. I'll try out your suggestions
06-21-2017 09:50 AM
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