LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simplify VI that is recording a rate but is currently using too many shift registers

Solved!
Go to solution
Solution
Accepted by topic author Pepi123

This may help.

Message 11 of 20
(1,221 Views)

The picture definitely helps. I will try it today report back this afternoon. Thank you!

0 Kudos
Message 12 of 20
(1,189 Views)

Since you're using that blue sub-vi in the loop already it's very neat when placed in a loop, you'll just need to wire the loop counter i to the input.

Once it works, that loop is also a perfect candidate to parallellize.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 20
(1,136 Views)

@Yamaeda wrote:

Since you're using that blue sub-vi in the loop already it's very neat when placed in a loop, you'll just need to wire the loop counter i to the input.

Once it works, that loop is also a perfect candidate to parallellize.

/Y


Hi Y,

Do you mind expanding on this a little more?

 

Thanks,

Pepi

0 Kudos
Message 14 of 20
(1,103 Views)

Here's how the loop would look like.

 

 

To parallelize it, you would need to first make the subVI reentrant (preallocate clones) and then make the FOR loop parallel. Naturally this only helps if your CPU has multiple cores. (see also this article). Your subVI is so lightweight that parallelizing will not gain much overall. I would not bother here.

 

(Of course the subVI would benefit from a serious makeover too. Eliminate the formula express VI, make a big case structure containing all code after the comparison. Resize the index array, eliminate all the representation mismatches (coercions), etc.

0 Kudos
Message 15 of 20
(1,091 Views)

@altenbach wrote:

Here's how the loop would look like.

 

 

To parallelize it, you would need to first make the subVI reentrant (preallocate clones) and then make the FOR loop parallel. Naturally this only helps if your CPU has multiple cores. (see also this article). Your subVI is so lightweight that parallelizing will not gain much overall. I would not bother here.

 

(Of course the subVI would benefit from a serious makeover too. Eliminate the formula express VI, make a big case structure containing all code after the comparison. Resize the index array, eliminate all the representation mismatches (coercions), etc.


Hi altenbach,

Thanks for the reply. I'm having an issue with different dimension arrays, and it seems that you don't because your wires in and out of the blue SubVI are not broken and when I try these my wires are broken.

 

Did you change the blue SubVI to get this to work? Did you resize the index array?

 

My biggest hurdle in LabView is understanding arrays so I'm stomped once again. I had the same issue when I tried the solution BowenM suggested.  

0 Kudos
Message 16 of 20
(1,074 Views)

Tunnels at loop boundaries can be non-indexing or indexing (plus some more options for the output tunnels, depending on the LabVIEW version). In this case, the upper input should be non-indexing so all subVI calls have the full 2D array. The lower input should be indexing, processing one row per iteration.

 

And so on.

 

Right-click each tunnel to change the indexing mode as desired.

 

(If this is not clear to you, maybe you should start with a few basic LabVIEW tutoials.)

Message 17 of 20
(1,057 Views)

@altenbach wrote:

Tunnels at loop boundaries can be non-indexing or indexing (plus some more options for the output tunnels, depending on the LabVIEW version). In this case, the upper input should be non-indexing so all subVI calls have the full 2D array. The lower input should be indexing, processing one row per iteration.

 

And so on.

 

Right-click each tunnel to change the indexing mode as desired.

 

(If this is not clear to you, maybe you should start with a few basic LabVIEW tutoials.)


Thanks again. I didn't know you can do that with loop boundaries. This worked, or at least the wires are not broken anymore and now I just have to run it and play around with the blue subVI if things are not working right.

 

I appreciate it.

 

Pepi

0 Kudos
Message 18 of 20
(1,022 Views)

Hi all,

How can I have individual indicators like I have in my original VI?

 

Should I use a similar method of using a separate "for loop" and putting an "index array" with the "i" from the loop connected to the "index" node and then somehow connecting it to individual indicators? 

 

Or do I have to have "n" amount of "index arrays". "n" being the number of indices I have?....Which I guess would put me in the same situation I was originally, which is have an index array for every channel I'm reading. 

 

Does that even make sense? I realize at some point I will have to have the same amount of indicators as I have channels because I want to see every channel in the front panel, but ideally I would like to have one "for loop" for the blue subVI,  one "for loop" for indexing the arrays and then the amount of indicators that I need.

0 Kudos
Message 19 of 20
(1,007 Views)

If you want individual indicators from an array simply add an "index array" function and resize it for the desired number of outputs. Connect the indicators in order and you don't even need to wire the indices. Leave the main data in the array for further processing.

 

If you design the from panel in a smart way, you can often use array indicators directly. Resize the container (horisontally oor vertically) to the desired number of elements and hide the index terminal.

0 Kudos
Message 20 of 20
(1,003 Views)