LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Memory Full

Hey everyone,

so I am completely new to Labview and just a student worker and my boss asked me to solve a problem with our old Labview programm. It was running (so he says) fine all the time until sudenly we got a message telling us, that a sub.vi has an error and it tells us that possible reasons might be full memory or NI:488, no listener for GPIB found.

We use TwinCat to initialyze the servos, so I guess, we can skip the part with the GPIB. 

Some facts from our system:

- Windows 7 Enterprise 32 bit

- AMD Athlon II X2 250

- 4 GB RAM

- LabVIEW 2015 SP1

 

Im not sure, how to upload the vi in one file with all its sub vis, so you guys could take a look at the programm. Because the deeper I move into the sub vis, the less I understand. And I already don't understand a thing.

Maybe you can take me in the right direction and give some tips. Thanks

 

0 Kudos
Message 1 of 28
(603 Views)

@Credible wrote:

Im not sure, how to upload the vi in one file with all its sub vis, so you guys could take a look at the programm.


Zip up the project and post the zip file. This works as long as the resulting file is not too large.

 

As far as your memory issue, the most common causes for this would be 1) building arrays or strings inside of a loop and 2) not properly closing references. If you can just isolate the VI that is throwing the error, that would help us help you debug the application.


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
Message 2 of 28
(591 Views)

Hey there @crossrulz,

 

thanks for your quick response. So there is this main vi (I guess) that i open, but is there any method to save alle the referred sub vis as well? I can't find it. But still, here is the vi that makes problems (and i cant tell which sub vi is the exact problem, because it looks like it's cycling through different errors before crashing.

 

 

 

0 Kudos
Message 3 of 28
(558 Views)

@Credible wrote:

... but is there any method to save alle the referred sub vis as well?


You can do a "save for previous" on the toplevel and pick the same version. It will create  hierachy of all dependencies that you can zip up.

 

I don't see anything that would give you glaring memory errors, but the code is very disorganized, so it is hard to tell. Of course there are glaring race conditions due to the blatant overuse of local variables and it seems you don't understand them. For example in the following segment you write the same value to the terminal AND to a local variable of the same terminal (100% redundant) and then read the value from another local variable. You cannot guarantee that the read happens only after the write, but the result will depend on the order.

 

altenbach_0-1730132614859.png

 

For each of the three sections, you can delete both locals and just wire across. Thinks dataflow! The wire is the variable! (This is only the top if the iceberg!)

 

Not sure why you need all these blue "-1" constants (six in this part alone!!!) if we have the negate function. Also note that both cases contain the same code, so why do these case structures even exist???

 

You have tons of subVIs that seem mostly identical, maybe only differing is a small part. Make the small part a control and make the subVI reentrant!

 

Why is the front panel and diagram maximized to the screen? Why do you have such a gigantic connector pane of nothing is even connected to anything?

 

0 Kudos
Message 4 of 28
(527 Views)

Hi Credible,

 


@Credible wrote:

So there is this main vi (I guess) that i open, but is there any method to save alle the referred sub vis as well? I can't find it


You were asked to ZIP the wole project, but instead you choose to attach only a single VI…

Do you need any more help for ZIPping a project folder?

 


@Credible wrote:

But still, here is the vi that makes problems (and i cant tell which sub vi is the exact problem,


On your VI:

It's no wonder your VI "makes problems" when there are those silly race conditions and non-sense code!

 

Edit: While I was writing my message Christian stumbled over the exact same problems in your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 28
(526 Views)

@altenbach wrote:


You can do a "save for previous" on the toplevel and pick the same version. It will create  hierachy of all dependencies that you can zip up.


Thank you. That was, what I was searching for. Therefore here is the complete folder.

 


@altenbach wrote:

 

For each of the three sections, you can delete both locals and just wire across. Thinks dataflow! The wire is the variable! (This is only the top if the iceberg!)


So does that mean, that I can link all the "Offset FWX" directly to each other. Is that what you mean?

 

And about the Sub Vis: I understand, that a lot of those are for controlling the electric motors or having a read back. I assume that it is somehow connected to the TwinCAT System, so I'm not sure to change them (because I obviously lack experience with this programm). Is there a way I can do what you told me in an easy way (didn't completetly get, what you meant with "Make the small part a control and make the subVI reentrant!")


Thanks in advance

0 Kudos
Message 6 of 28
(476 Views)

@GerdW wrote:

Hi Credible,

 


@Credible wrote:

So there is this main vi (I guess) that i open, but is there any method to save alle the referred sub vis as well? I can't find it


You were asked to ZIP the wole project, but instead you choose to attach only a single VI…

Do you need any more help for ZIPping a project folder?

No, but I needed a way to pack all the Vis (because I dont know, where all of those were) in one folder. Therefore the answer by crossrulz was helpful with saving it for a later version.

 


@GerdW wrote:

 

It's no wonder your VI "makes problems" when there are those silly race conditions and non-sense code!


Again, I am a student worker who was given this task. This is neither my code nor is it necesseray to point out, how sill and non-sense it is. 

It is wha I have to deal with and therefore I would be thrilled to get some valuable input on how to improve things. I am more than happy to learn this code, so teach me the proper way.

 

Still best regards!

0 Kudos
Message 7 of 28
(471 Views)

Hi Credible,

 


@Credible wrote:
I would be thrilled to get some valuable input on how to improve things. I am more than happy to learn this code, so teach me the proper way.

There is no project file in your ZIP (atleast I didn't see it)!

Start with creating a proper lvproj file for your LabVIEW project!

 

These are two of your subVIs:

They are IDENTICAL!

Instead of creating several copies of the same code you should just use the very same VI!

Please check all your subVIs for identical code and remove copies…

 

(Are you sure you don't need to close all those DotNet references in your subVI?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 28
(455 Views)

As said, there are many things to improve about the code, but if your boss is happy with its functionality, don't waste time refactoring the code. Focus on the problem given to you and try to fix just the error.

 

Some questions: Which subvi, and more specifically, which function inside that subVI, is giving the error? What is the actual error code and description?

 

If you are having trouble. Select View>>Show Tools palette and select this option. Then click on a wire that is giving the error to get a detailed error description.

Basjong53_0-1730196164405.png

 

Alternatively, add Basjong53_1-1730196245190.pngafter your function that gives the error.

 

 

0 Kudos
Message 9 of 28
(445 Views)

@GerdW wrote:

Hi Credible,

 


@Credible wrote:
I would be thrilled to get some valuable input on how to improve things. I am more than happy to learn this code, so teach me the proper way.

There is no project file in your ZIP (atleast I didn't see it)!

Start with creating a proper lvproj file for your LabVIEW project!


I did now. I assume a project folder helps with having all files together?

 


@GerdW wrote:

Hi Credible,

 

They are IDENTICAL!

Instead of creating several copies of the same code you should just use the very same VI!

Please check all your subVIs for identical code and remove copies…

 

(Are you sure you don't need to close all those DotNet references in your subVI?)





Will do! Thank you. However I am not sure, why they are the same. They shoul (as is my understanding) control different motors, so shouldnt they be different then?

And how could u see all of the case frames next to each other?

0 Kudos
Message 10 of 28
(441 Views)