04-05-2022 06:01 AM
hi, I built a project, and used some sub VIs for the main VI, and the main VI size is about 5M now, the project is pretty simple with basic functions like below
1, two VISA to communicate with my devices
2, about 5 XY charts are drawn in when runing
3, lots of global variables and local variables
4, related data processing calculations
the project runs well, but the problem now is that it always takes about 3-5 minuts when I click '''save all files' everytime after I modified something. it really consumes me lots of time, but I have no idea what the computer is doing when I save the project.
appreciate if someone can give me help on this.
thanks.
04-05-2022 06:07 AM
BTW , before this happens, there was no problem when I did almost the same with other LV projects, so I do not thinkg this is something about my computer.
04-05-2022 06:27 AM
Hi Dou,
@Powerdou wrote:
the main VI size is about 5M now,
I guess that's your main problem!
Try to reduce the mainVI size…
04-05-2022 06:29 AM - edited 04-05-2022 06:31 AM
5 MB is not a good size for a VI.
When you say it wasn't slow before, was this in another version of LabVIEW? The compiler changed between 11 and 12 (IIRC) and the new LLVM compiler doesn't handle large VIs as good as the old one.
1 MB is big... 5MB is huge. There is probably some non-linearity going on, so from 1 to 5 MB could increase load\save\compile times quite a bit.
04-05-2022 07:20 AM
Thanks for your inputs!
1, I am using same 2021 version now and before
2, yes, there one sub-VI for exponential function calculation to draw a XY chart, but I am using a 1000 steps “for while” for the calculation, and this sub-VI is not always running, it only starts to run when being called by Main VI, and stops when it completes its for while loop.
3, BTW, There is a event case structure also used in my main VI, and there are about 200 cases included in this event case structure , is this the problem?
4, for the scenario like my project, I can not reduce the cases in my event case structure, is there any good suggestion for me?
thanks.
04-05-2022 07:29 AM
Also, there is another problem I forgot to mention above.
some parts size changed a lot ( resized a lot) in front panel after I saved the project, this problem started from this afternoon.
04-05-2022 07:38 AM
Hi Dou,
@Powerdou wrote:
Also, there is another problem I forgot to mention above.
some parts size changed a lot ( resized a lot) in front panel after I saved the project, this problem started from this afternoon.
Again: the main problem is that huge mainVI. Reduce its size by refactoring…
Simple solution to your "started from this afternoon" problem: revert to an older revision of your VI using your SCC tool!
04-05-2022 08:28 AM
5 MB is very big if it's code. If it's due to some background picture on the UI or Default values in controls it's another matter.
I had a project that took ages to compile, it turned out i had some circular dependancies. Those can be quite hard to find though.
As suggested, start by refactoring and break out sub-vi's.
04-05-2022 08:44 AM
@Powerdou wrote:3, BTW, There is a event case structure also used in my main VI, and there are about 200 cases included in this event case structure , is this the problem?
It won't help...
@Powerdou wrote:4, for the scenario like my project, I can not reduce the cases in my event case structure, is there any good suggestion for me?
Reduce the number of cases anyway.
There's no scenario where you want to have 200 event structure cases.
When you say you can't reduce that number, you probably mean you don't know how to do it.
We can help with that.
04-05-2022 09:16 AM - edited 04-05-2022 09:20 AM
@Powerdou wrote:
Thanks for your inputs!
1, I am using same 2021 version now and before
2, yes, there one sub-VI for exponential function calculation to draw a XY chart, but I am using a 1000 steps “for while” for the calculation, and this sub-VI is not always running, it only starts to run when being called by Main VI, and stops when it completes its for while loop.
3, BTW, There is a event case structure also used in my main VI, and there are about 200 cases included in this event case structure , is this the problem?
4, for the scenario like my project, I can not reduce the cases in my event case structure, is there any good suggestion for me?
thanks.
This may make our eyes bleed but you are going to have to show us your code unless you want guesses.
Specific answers.
3: Yes, 200 event cases is a problem! A very big problem! What kinds of Events are they? Application? Filter? User? Dynamic? 200 user events is insane. 200 Dynamic events would have very bad code smell and could likely be simplified to postcard sized code.
4:I don't believe you have 200 unique "things to do" when something else happens. I suggest you let us review the code.
OTHER concerns:
3+ minutes to save all is not normal.
You are almost certainly using Local and Global variables wrongfully.