LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simplifying Code

Solved!
Go to solution

Hello!

 

I have this code snippet, with shift registers, it draws the last 20 plot to the same graph as you see on the botton of the picture. Any of you have an idea how to make this code more compact? Or somebody have a solution to make it scalable, for example if i want to use the last 100 plots?

Thank you in advance!

0 Kudos
Message 1 of 20
(2,889 Views)

This is not a snippet, but a plain image. We cannot simplify images, so please attach your VI instead.

Yes, this can be dramatically simplified by using a single 2D array in a single shift register and replacing the oldest row when new data arrives.

0 Kudos
Message 2 of 20
(2,879 Views)

It's a big project, i meant snippet as the part of the image. But can you post a code like you described?

0 Kudos
Message 3 of 20
(2,872 Views)

I am sure there are already examples here. Will check later (currently posting by phone).

0 Kudos
Message 4 of 20
(2,865 Views)
Solution
Accepted by topic author gbvbalint

It look like you are actually making an array of clusters.  So make the shift register an array of these clusters.  You can then increment which waveform to replace with each iteration.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 20
(2,856 Views)

Thank you!

0 Kudos
Message 6 of 20
(2,824 Views)

What is on the input of initialize array? I have LV 2012 so i couldnt opne the snippet.

0 Kudos
Message 7 of 20
(2,816 Views)

Cluster constant.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 20
(2,796 Views)

@gbvbalint wrote:

What is on the input of initialize array? I have LV 2012 so i couldnt opne the snippet.


It is a constant of the waveform.  Create a constant from where you get your spectrum data and wire that into the Initialize Array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 20
(2,793 Views)

Its not really working tho 😕

0 Kudos
Message 10 of 20
(2,792 Views)