LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Insufficient system resources error

Solved!
Go to solution

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. 

20220913_150237_edit.jpg

0 Kudos
Message 1 of 24
(2,070 Views)

Hi Alex,

 


@EssperAlex wrote:

Please advise on where could had gone wrong.


  • No need to hijack a 16 year old thread 15 years after the last message in this thread. (They even talked about other issues…)
  • Attaching an image of a small part of your code when you want to discuss problems of that code… We cannot edit/run/debug images with LabVIEW!
  • Having "many nested while loop" in your code…
  • Having Rube-Goldberg in your code, like a case structure to invert a boolean value…
  • Running the VI several times using RunContinuously (?)

 

@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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 24
(2,046 Views)

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. 

Download All
0 Kudos
Message 3 of 24
(2,009 Views)

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.

0 Kudos
Message 4 of 24
(1,966 Views)

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. 

0 Kudos
Message 5 of 24
(1,951 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 24
(1,941 Views)

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.

0 Kudos
Message 7 of 24
(1,923 Views)

@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).

santo_13_0-1663212790187.jpeg

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 8 of 24
(1,911 Views)

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. 

0 Kudos
Message 9 of 24
(1,896 Views)

@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.

Message 10 of 24
(1,866 Views)