From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make read from spreadsheet vi faster


@Ravens Fan wrote:

Follow Yamaeda's link for how to implement an action engine.  You will basically need 2 actions.  Load and Get Data.

 

Your image of the Index Array is much better.  Here is another tip that will help.  Since it looks like you have all the indices from 0 to 7 used, if you rearrange all of your indicators in order, you can get by just wiring the 0 constant at the very top output like you have now which defines the 0th column.  Eliminate all of the other constants.  All of the outputs below that will be the 1st, 2nd, 3rd, .... 7th columns by default automatically.  It's a way of saving time of having to duplicate all of those extra constants and changing them manually to sequenctional numbers.


I am studying on action engine. I will take your advice for the next time on index array. Did you know how to save XY-graph without resetting?

Egemen
0 Kudos
Message 21 of 27
(500 Views)

To retain all previous data on your graph, you could create a feedback loop that takes your current data and passes it to your build array function through a feedback node (see attached image for example). To retain only x number of previous data plots, you could use shift registers.

0 Kudos
Message 22 of 27
(478 Views)

@MarcusB wrote:

To retain all previous data on your graph, you could create a feedback loop that takes your current data and passes it to your build array function through a feedback node (see attached image for example). To retain only x number of previous data plots, you could use shift registers.


I tried your suggestion but it press all data on graph and that's not what I want. I want to see only the last graph on the XY-graph but when I want to see the previous graphs I desire to see them via scrolling the x scroll right lower side.

Egemen
0 Kudos
Message 23 of 27
(464 Views)

The x scroll bar you see below your XY-graph is for scrolling across the x axis only. To see previous graphs, you would need to retain all previous data inside an array and use a numeric control to index through your previous data to control what is displayed. See the attached image for an example of how to do this.

0 Kudos
Message 24 of 27
(453 Views)

@Yamaeda wrote:

Ah, now it starts to make sense. In In the sub-vi, possibly in several places, you read a file (why?) which'll cause 6*X file reads, and i guess you have a open/close connected to that also. If you want to read a file in a loop, try to make sure you only read it once, and use that data in all calculations. Keep file opening/closing outside the loop.

 

/Y 



I changed the whole VI and it reads only once from txt files at the beginning of the for loop and this approach make it really faster. It seems works for me for now. But still so I need to adapt this VI t action engine? I attached the modified VI. I am open to all suggestion on it.

Egemen
0 Kudos
Message 25 of 27
(420 Views)

Instead of indexing the arrays inside of the FOR loop, use autoindexing tunnels.  That will also remove the need to wire the N of the loop.

 

You might also want to consider using clusters to group your data.  1 wire is a lot easier to handle than 9.  That will clean up your code quite a bit.


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 26 of 27
(410 Views)

Crossrulz has a good point (which has been mentioned earlier). It also seems like you're using the same sub-vi 6 times with the only difference being the 2 single values. Make an array of those values and put the sub-vi in a loop instead. It'll clean stuff up alot. 🙂

 

AE isn't obligatory, if it works now all is well.  

 

/Y 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 27 of 27
(392 Views)