07-26-2016 08:15 AM
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!
07-26-2016 08:28 AM - edited 07-26-2016 08:29 AM
07-26-2016 09:54 AM
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?
07-26-2016 09:57 AM
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!
07-26-2016 10:14 AM
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.
07-26-2016 10:20 AM
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.
07-26-2016 12:56 PM
I don't actually know how one measures subVI time,
Blog for (mostly LabVIEW) programmers: Tips And Tricks