06-22-2023 09:10 PM
@RTSLVU I have a question specifically for you about the block diagram that you posted here, but I will not ask because I don’t want to change the subject.
06-23-2023 08:13 AM
@Gregory wrote:
Also, here is a simple way to abuse a queue to do it for you.
This is not an "abuse of a Queue" -- rather it is the "creation of a Ring Buffer", a structure that "saves the last N samples you feed to it", perfectly suited to "hold the last 15 minutes of data".
Bob Schor
06-23-2023 08:27 AM
@GRCK5000 wrote:
@RTSLVU I have a question specifically for you about the block diagram that you posted here, but I will not ask because I don’t want to change the subject.
As I quick comment to that, it seems not scalable and would need to rewritten from scratch whenever the number of signals change and if we have an array of 100 temperatures, things become unmanageable. Then there is all that duplicate code!
06-23-2023 09:04 AM
Thanks Mr. Altenbach! You already knew what I was going to ask 😄
06-27-2023 09:02 AM - edited 06-27-2023 09:27 AM
@altenbach wrote:
@GRCK5000 wrote:
@RTSLVU I have a question specifically for you about the block diagram that you posted here, but I will not ask because I don’t want to change the subject.
As I quick comment to that, it seems not scalable and would need to rewritten from scratch whenever the number of signals change and if we have an array of 100 temperatures, things become unmanageable. Then there is all that duplicate code!
Yeah I know it's not very scalable. I wrote this over a decade ago for a power transformer qualification test and the transformers always had the same number of embedded thermocouples.
I never got around to making it scalable because I never really needed it again. But I would guess as long as your temperature measurements are coming in a 1D array and you are good with array manipulation you could use a 2D array to store all the measurements and reduce the redundant code.
06-27-2023 10:08 AM - edited 06-27-2023 10:09 AM
@RTSLV I bet it was when you first started to learn LabVIEW. I cannot imagine you coding like this. This looks more like my code 😂
06-27-2023 10:27 AM
@GRCK5000 wrote:
I cannot imagine you coding like this.
Easy there. This is perfectly good code and might even be better in this particular case.
I think "rotate array" has some compiler optimizations where it actually does not move elements in memory so that might be lost if we rotate a 2D array in a FOR loop. Also the explicit version can be better parallelized. It is not always clear cut.
However, array "min&max" does not depend on order so rotating is not even needed if we just keep track of the insert point in a shift register instead. I would even get rid of the while loop and use a globally initialized shift register instead. The init case should have a control for history size. The mode should have a default value that is the most often used case, maybe it already is.