01-18-2017 01:06 PM - edited 01-18-2017 01:13 PM
I use a queue to transport data between different VI.
My problem: Labview crashes sometimes.
Have created a TestVI. -> The counter stops at 2 ^ 10!! -> No Message , nothing -> Crash
I am happy about every Idea.
Thanks Daniel
01-18-2017 01:12 PM
Does it crash with an "out of memory" message?
If so, move the Get Queue ref to the outside of the loop so that you are not creating a ref to the queue a zillion times.
Ben
01-18-2017 01:20 PM - edited 01-18-2017 01:24 PM
Thanks Ben
The Idea is to generate the Queue Ref if i need it.
The App run 3-4 Months nonstop!
I never read a Guideline: you can't search the Queue Ref more than 2^10 😞
01-18-2017 01:22 PM
Then use a Singleton approach and only get a ref if it does not exist. Otherwise use the one you have.
Closing the queue ref may also help a bit.
Ben
01-18-2017 01:59 PM
Daniel1978 wrote:
I never read a Guideline: you can't search the Queue Ref more than 2^10 😞
It is more of proper handling of references in general.
1. If you open a reference, close it.
2. There is a limit on how many references you can have since a reference it really just an I32.
It sticks in my mind that the number of queue references was limited by something other than the I32 type. I would have to do some major digging to find that tibit again. So my guess is that you are just running into that limit.
01-18-2017 02:07 PM
Just ran your VI in LabVIEW 2016. The queue reads actually got up to 2^20 and it just caused the program to freeze. After killing LabVIEW and restarting it, I just added a Release Queue after the Preview Queue and it is running way past that limit (almost 100M iterations).
So the lesson learned here:
1. Close your references.
2. It is best not to re-open references if you can help it.
01-18-2017 02:36 PM
@crossrulz wrote:
Just ran your VI in LabVIEW 2016. The queue reads actually got up to 2^20 and it just caused the program to freeze. After killing LabVIEW and restarting it, I just added a Release Queue after the Preview Queue and it is running way past that limit (almost 100M iterations).
So the lesson learned here:
1. Close your references.
2. It is best not to re-open references if you can help it.
Hit Ctrl+I
That test vi was sourced in LabVIEW 8.6 If I'm not thoroughly mistaken Queues were reworked for LabVIEW 2009. so comparisions running on modern versions don't really mean much.
I totally agree that the references are completely mishandled. However, the ref to the named queue should return a ref to the named queue (Test for equality to prove its a ref to the same object, cast to int to prove its the same referance to that object) That "Might" have changed between Pre 8.6 and post 2009. It has been several years since I've had 8.6 to play with. (Oh, I have media I just have no machine with that old a version installed)
01-18-2017 02:40 PM
@JÞB wrote:
That test vi was sourced in LabVIEW 8.6 If I'm not thoroughly mistaken Queues were reworked for LabVIEW 2009. so comparisions running on modern versions don't really mean much.
The other VI the OP supplied was written in 2015. Yes, I looked at the version before doing anything.