LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow 2D Array flip

Hi,

 

I am trying to mirror a 2d array horizontally during each loop of a data acquisition VI, but the subVI I have written takes too much time to execute and slows the data acquisition down significantly. Does anyone have an alternative method or some other suggestion to speed up my execution time? 

 

Thanks!

0 Kudos
Message 1 of 7
(3,792 Views)

Hi hhart,

as I don't have LV2015 available right now I cannot look into your VI.

My suggestion is:

check.png

Please define "too slow" and "how fast does it need to be"!

Best regards,
GerdW


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

There is no problem in the subvi which you sent and since you didn't provide default data it is difficult to see what's wrong.

-Post entire code if possible, 2d array if it's too big then it might take time.

-What's the size of array?

-How much time it is taking?

Thanks
uday
0 Kudos
Message 3 of 7
(3,770 Views)

My apologies, I'm not sure what happened, but my data acquisition works fine now. I think my computer was running slowly. Thanks for the attempts, though!

0 Kudos
Message 4 of 7
(3,768 Views)

What makes you think that this subVI is the time limiting step? Maybe the problem is elsewhere. How do you measure the subVI time? How does it fit into the rest of the code?

 

If you suspect the subVI, make sure that it's front panel is closed during run (else it takes time to update the controls and indicators with current data). You should also disable debugging. You could even inline it.

 

How big is the input array and does it have the same size with each call? Where does the array come from? Where does it go? (e.g. if you are just graphing it, you could just reverse the axis instead by using a negative dx). If you are building an evergrowing 2D array and reverse it for processing, you might consider reversing the new data before building instead.

 

It is difficult to give more detailed advice without seeing the rest of the code.

 

 

0 Kudos
Message 5 of 7
(3,758 Views)

Yeah, again, I'm pretty sure the issue was that I had just turned on my computer and there were probably some background processes slowing it down. I thought I had isolated the VI as the problem because the problem went away when I removed it, but it never happened again, even when I replaced it.

 

And to answer a few of your questions, I was flipping the array (which was the same size each loop iteration) before adding it to a queue. I don't actually know how one measures subVI time, but the chart that I had displaying the data had some visible lagging issues initially, so that's why I concluded that some part of the VI was running 'slowly', or too slow for the data acquisition to keep up. 

 

Thanks again for trying to help, I just made a dumb mistake.

0 Kudos
Message 6 of 7
(3,755 Views)

I don't actually know how one measures subVI time,

 

How Fast is This?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 7
(3,734 Views)