09-13-2022 10:01 AM
Hi
I have an issue with my VI whereby I had encountered this issue too. After running for multiple times for about >45mins over many nested while loop (about >250times). My labview device will encounter error -1073807300, insufficient system resources.
But I am pretty sure, I had use the driver close function at the end of the loop.
I am currently using Labview 2021, 32bit. Please advise on where could had gone wrong. As if I were to run below 200times, there is no error occurring on the whole VI. Everything will run smoothly.
Solved! Go to Solution.
09-13-2022 11:45 AM
Hi Alex,
@EssperAlex wrote:
Please advise on where could had gone wrong.
@EssperAlex wrote:
As if I were to run below 200times, there is no error occurring on the whole VI. Everything will run smoothly.
Attach your code. Real code, not just images of code.
Explain where exactly that error occurs!
What have you done to debug your VI? Did you even try to debug it?
Is there some error handling or logging?
09-14-2022 03:53 AM
Hi Gerd,
First of all, thank you for the reply and sorry for posting onto an very old post.
@GerdW wrote:
- Running the VI several times using RunContinuously (?)
Regarding to this, I use Run instead of RunContinously. My Loop will run multiple time according to the number of time I set.
@GerdW wrote:
@EssperAlex wrote:
As if I were to run below 200times, there is no error occurring on the whole VI. Everything will run smoothly.
Attach your code. Real code, not just images of code.
Explain where exactly that error occurs!
What have you done to debug your VI? Did you even try to debug it?
Is there some error handling or logging?
Yes, I had tried bugging by adding VI driver close behind the test or when I open the resources. Or adding 150ms delay/stall data timing after initializing the driver which I read up from other forum and said it might. helps.
The error that occurs randomly, there is no specific placement on it. Some times it's after the while loop where it changing from min to max. Or when it occurs during the most inner while loop still running halfway at the For-Loop. But it's always "Insufficient System Resource".
I had extracted out the particular loop (SampleLoop1) to try and tested today again and it seems to be running properly without any issues even running for long hours but the issue occurs when I combine everything together and run for long time.
I had attach my VI for more understanding, the part of the VI where the error usually appeared is SampleLoop1 and the full program VI is TestProgramV6. Thanks! Any help will be appreciated as I had been stuck at this problem for some time. Whenever I tried to run the VI for long hours.
09-14-2022 03:30 PM
I figured I would take a look to see if maybe there was a resource you were opening and not closing a lot, or an expanding array size, or something.
Instead, I found that your main VI's block diagram is about 13 screens wide and 8 screens tall (rough estimate) and has structures in it such as 4 nested while loops inside of 9 nested case structures.
All I can say is that you're in dire need of a rewrite. Start by learning how to use Boolean logic to AND together all of your case statements instead of nesting them all on top of each other. I also saw what looked like quite a lot of places using the same copy-pasted code... learn how to create and use subVIs so that your code is both much smaller and also has far less copy-pastes of the same or near-same code.
09-14-2022 07:32 PM
Hi Kyle,
Thanks for the advise and help.
@Kyle97330 wrote:All I can say is that you're in dire need of a rewrite. Start by learning how to use Boolean logic to AND together all of your case statements instead of nesting them all on top of each other. I also saw what looked like quite a lot of places using the same copy-pasted code... learn how to create and use subVIs so that your code is both much smaller and also has far less copy-pastes of the same or near-same code.
I will also try and look into it to see if I were to able to minimize the size of the whole VI.
But the main reason on why I didn't use subVI on those loop is due to I would need to see live results on every single loop on the table. If I were to subVI the loop, I found out that I am unable to see the live result until the whole subVI finished the execution than I will be able to see the whole result.
About the Boolean logic on my case statements, I will try to use "OR" logic and see if I were able to get the same result.
09-14-2022 08:51 PM
@EssperAlex wrote:
Hi Kyle,
Thanks for the advise and help.
@Kyle97330 wrote:All I can say is that you're in dire need of a rewrite. Start by learning how to use Boolean logic to AND together all of your case statements instead of nesting them all on top of each other. I also saw what looked like quite a lot of places using the same copy-pasted code... learn how to create and use subVIs so that your code is both much smaller and also has far less copy-pastes of the same or near-same code.
I will also try and look into it to see if I were to able to minimize the size of the whole VI.
But the main reason on why I didn't use subVI on those loop is due to I would need to see live results on every single loop on the table. If I were to subVI the loop, I found out that I am unable to see the live result until the whole subVI finished the execution than I will be able to see the whole result.
About the Boolean logic on my case statements, I will try to use "OR" logic and see if I were able to get the same result.
The only reason a subVI would hold up the rest of the loop is because of poor architecture. This feels like yet another reason for a rewrite.
09-14-2022 09:47 PM
Hi Billko,
@billko wrote:
The only reason a subVI would hold up the rest of the loop is because of poor architecture. This feels like yet another reason for a rewrite.
May I know what is a poor architecture or can you explain it in more details? I think I might had made mistake when trying to create a SubVI as I am relatively new to LabView.
Do you have any sample illustration to show?
If I'm able to reduce the size by making the SubVI, It might resolve the issues I am currently having on the insufficient system resource.
Currently I am now trying to reduce the whole program in size and remove any unnecessary function.
09-14-2022 10:34 PM
@EssperAlex wrote:
Hi Billko,
@billko wrote:
The only reason a subVI would hold up the rest of the loop is because of poor architecture. This feels like yet another reason for a rewrite.May I know what is a poor architecture or can you explain it in more details? I think I might had made mistake when trying to create a SubVI as I am relatively new to LabView.
Do you have any sample illustration to show?
If I'm able to reduce the size by making the SubVI, It might resolve the issues I am currently having on the insufficient system resource.
Currently I am now trying to reduce the whole program in size and remove any unnecessary function.
Just to clarify, size is not the factor causing the error on insufficient system resources. But at least it will take you on the path of best practices which in turn would eliminate a lot of the beginner errors and help anyone to read and debug your code.
Imagine yourself trying to figure out the wire feeding electricity to your house to fix in this messy pole, this is analogous to some of your code (not exactly).
09-15-2022 02:46 AM
Hi all,
I had run multiple time on my full VI today with just minor amendment on the reducing "Local Variable" & sizing. I managed to run slightly longer than usual by a few more steps. (Not sure if it does help).
But I had came to realize that, the initial error occurs is always at "Chr61507 Initialize with Option.Vi". The error is always "Insufficient system resources".
Whereby when I called the AC source Vi. during the Initialize with option.vi the error will occurs after long run.
I had attached the following VI files that causes the error. Please advise/help on how to resolve this issues.
09-15-2022 12:35 PM
@EssperAlex wrote:
But the main reason on why I didn't use subVI on those loop is due to I would need to see live results on every single loop on the table. If I were to subVI the loop, I found out that I am unable to see the live result until the whole subVI finished the execution than I will be able to see the whole result.
I would like to say that you absolutely CAN see live results from subVIs if you have created your program in the correct way. If you're just using indicators and controls and local variables then yes, you need it all on one VI.
But if you switch to a messaging protocol for updating your controls (queues, notifiers, events, etc.) you can make a loop on your main VI that updates from subVIs.
Or you can update controls via reference (reference their controls and use property nodes, or use DVR references).
Or you could even put the subVIs in a sub-panel and they will look like they are part of your main VI.
Or you could have the subVIs run as pop-up VIs, show the results there, and when they finish also show the results on your main VI.
None of these changes will directly solve your running out of resources problem, but it will make the actual issue MUCH easier to find, and make it far easier to add other changes to your code later.