LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make read from spreadsheet vi faster

hi all,

I am working on a VI that reads an experiment data in txt format. There is 1057 rows and 24 columns. The program reads not all columns just specified columns and show these values in a XY graph. But the program runs too slowly. It is capable of showing 1 diagram on XY graph once in a second. I want to make this process faster than it is now. How can I succedd to do it? And also, on each loop, thee XY-graph resets itselfs, I do not want it to do it but I really do not know how to do it. Could you help me on these? (NOTE: The program includes a lot of subvis but I really do not know how to attach them all here, that's why I did not attach ll of them here)

Egemen
Download All
0 Kudos
Message 1 of 27
(3,592 Views)

The VI you posted should run fast enough (although it'll look better if you Replace the stacked sequence with a flat sequence, then remove sequence, then do a automatic diagram cleanup (ctrl+u))

I assume the culprit is the sub-vi, if it's only doing calculations with the in parameters you can set it Reentrant to allow all to run in parallell.

 

/Y 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 27
(3,588 Views)

@Yamaeda wrote:

The VI you posted should run fast enough (although it'll look better if you Replace the stacked sequence with a flat sequence, then remove sequence, then do a automatic diagram cleanup (ctrl+u))

I assume the culprit is the sub-vi, if it's only doing calculations with the in parameters you can set it Reentrant to allow all to run in parallell.

 

/Y 


I will try flat sequence. But I could not understand that you said "then remove sequence, then do a automatic diagram clean up." what did you mean exactly? what is culprit? What did you mean via running parallel? I am not an expert of labview that's why I asked alot to you. I am sorry for that.

Egemen
0 Kudos
Message 3 of 27
(3,580 Views)

1. R-click stacked sequence -> Replace with Flat sequence

2. R-click flat sequence -> Remove sequence

3. Press ctrl+u (automatic diagram cleanup)

 

It looks better and is a first step to think without sequence structures. 😉

LV optimizes such that if it can run several VI's at the same time (in parallell) it will try to do so. Placing your sub-vi in the sequence prevents this.

A Sub-vi can per default only run with 1 instance, so the fact that you have 5 forces them to wait for each other. If they are Reentrant (VI property -> Execution) they are allowed to run at the same time.

Depending on what's happening inside the sub-vi it can increase performance alot.

 

/Y 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 27
(3,570 Views)

@Yamaeda wrote:

[..]

Depending on what's happening inside the sub-vi it can increase performance alot.

 

/Y 


But it could also mess up the whole functionality 😉

Using parallelism properly requires some programming experience. You have to address several issues, race conditions being one of the most (in)famous.

You should try Y's suggestion and start collecting your own experience. Whenever in doubt, don't hesitate to search the LV help, online resources and if you find nothing useful, post a question here.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 27
(3,568 Views)

@Yamaeda wrote:

1. R-click stacked sequence -> Replace with Flat sequence

2. R-click flat sequence -> Remove sequence

3. Press ctrl+u (automatic diagram cleanup)

 

It looks better and is a first step to think without sequence structures. 😉

LV optimizes such that if it can run several VI's at the same time (in parallell) it will try to do so. Placing your sub-vi in the sequence prevents this.

A Sub-vi can per default only run with 1 instance, so the fact that you have 5 forces them to wait for each other. If they are Reentrant (VI property -> Execution) they are allowed to run at the same time.

Depending on what's happening inside the sub-vi it can increase performance alot.

 

/Y 


I tried Yamaeda's suggestions. I changed the sequence structure to flat one and after it remove the structure and activate the reentrant function from VI properties>execution. There was no significant change in run time.:( It shows 2-3 samples once in a second while the old one reads just 1 sample once in a second. But I learnt that the sequence structure makes the VI slow. I thought that the main reason for running slowly of this VI due to read from spreadsheet vi but I am not sure. Is there a way to convert text files to binary files? I thought reading from binary files instead of text files makes vis faster but I am not sure about this too. Could you have other suggestions on it. By the way, I could not find the save XY-graph to see the latest situations on it. It resets all data except the latest one. How could I change it?

Egemen
0 Kudos
Message 6 of 27
(3,560 Views)

You read the spreadsheet once, outside the loop, so it doesn't affect loop speed. What's happening inside the sub-vi? Are you reading from a VISA resource? If so, doing that 5 times will affect speed alot.

/Y 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 27
(3,554 Views)

Just to make your life easier, you should change your while loop into a for loop and use the autoindexing tunnels.  Then you don't have to index out all of those arrays (see attached).

 

Could you post your subVI?  There might be something in there slowing you down.



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 8 of 27
(3,553 Views)

@Yamaeda wrote:

You read the spreadsheet once, outside the loop, so it doesn't affect loop speed. What's happening inside the sub-vi? Are you reading from a VISA resource? If so, doing that 5 times will affect speed alot.

/Y 


This vi is used just to read from an experiment result and plot it on to a XY-graph. There is no a DAQ session. In while loop there is a subvi named Read_R600a_Comp_Sup_CompatibleMod_foracquireddataanalysis_v1(SubVI).vi. This subvi (attached) contains a lt of subvis in it and it is a little complicated. Hence, I got a problem in it then.

Egemen
0 Kudos
Message 9 of 27
(3,545 Views)

@crossrulz wrote:

Just to make your life easier, you should change your while loop into a for loop and use the autoindexing tunnels.  Then you don't have to index out all of those arrays (see attached).

 

Could you post your subVI?  There might be something in there slowing you down.


Thank you crossrulz. I have just attached the subvi at the previous post. I could not open your vi attached because I have labview 2009 version. Could you resend is again in 2009 version? I will try your suggestion about for loop as soon as possible. Thanks again.

Egemen
0 Kudos
Message 10 of 27
(3,544 Views)