LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 8.6 has encountered a problem and needs to close.

In my program, I open and close a comport.

 

When closing my VI, I the a popup saying "LabVIEW 8.6  has encountered a problem and needs to close."

 

Why is this, could this be a memory leak?

 

Is there any utilities to analyse my VI to find the cause?

 

 

 

0 Kudos
Message 1 of 6
(3,549 Views)

Hi Morngoose,

 

Thanks for the post and I hope your well.


Well it could be the way your code handles the data from the comport? or is it just opening and closing?

Maybe you could post some example code?

Does this happen everytime?what about after rebooting the machine?

Another machine?

 

If you believe it could be memory related there are many tools in LabVIEW:

 

Generally regarding memory usage you could try using the VI Anyliser (Tools>>VI Profilier..) and the  Show Buffer Allocations (Tools>>Profile) to see areas of extra memory created. Particularly if your dealing with arrays, make sure you initalize the array and then just shift the array around the loop to update its values. I would also recommend to be careful with the use of any variables. And my last tip - are you doing any writng to file? I would make sure your closing of any references to such tasks. All of these would cause (could cause) memory issues (leaks). 

 

What makes you think it could be memory related?

 

Hope this helps,

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 6
(3,543 Views)

Thanks for your reply James.

 

Do I need the Professional Development suite for the VI Analyzer ? I've only got the Full Development suite.

 

It happens 2 in every 3 times, and sometimes very random.

 

I open the comport (visa), send some data, which then causes the comport to continuously send data back. I close the comport

at this stage. Read in reviews, that I need to flush the receive buffer, so I do this the moment before I close the port.

So, I suspect there is data in the receive buffer, when I close the port, and this gives me the error.....? Could this be true?

 

See my open, close, send and receive functions attached.

(The device operates like an AT modem)

Download All
0 Kudos
Message 3 of 6
(3,538 Views)

Hi Morngoose,

 

Thanks for the reply.

 

The VI Analyzer is part of the Productivity Toolkit which is only included in the Developer Suite, but can be brought seperately.

 

Flushing the buffer is a good way to ensure the data you read is desired data. When you do your read and you first testing how many bytes are at the port to read? Its normally a good idea to read all bytes available to prevent buffer issues.

 

Could you maybe test your code to see if data is still in the buffer? Does your PC usage go up?

 

Hope this helps,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 4 of 6
(3,531 Views)

Would the Productivity Toolkit be able to find my problem?

Is there a trial version I can use?

 

Tried to find this toolkit on your website, but failed.

0 Kudos
Message 5 of 6
(3,514 Views)

Hi Morngoose,

 

Thanks for the reply and I hope your well today.

 

The productivity toolkit - which includes anaylzer toolkit is not for download currently. You can however buy the anaylzer toolkit seperately.

 

I would like to help you resolve the error your seeing? Did you say adding the flushes resolved the issue?

 

Other, can I check that it's not necessary to explicitly open and close a VISA session. Your memory leak may be a result of opening a Visa session and then not closing it. And your not looping the open.closes?

 

Also, I wanted to check that your machine has enough memory for the data your receiving, as your data is read in your memory useage will increase.

 

I could also suggest upgrading to the latest version of VISA. You can find this at ni.com/downloads

 

Hope this helps, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 6 of 6
(3,491 Views)