Jump to content

Error when flush and destroy queue!


Recommended Posts

Hi,

I have a problem with the queue. After creating and using the queue to pass data, I try to flush queue then destroy it. But I meet this error:"Error 1 occurred at Release Queue in ...". I don't have much experience when working with a queue. Please give me some recommends on this issue.

THank you in advance for your time of reading and answering this question.

Thang Nguyen

Link to comment

QUOTE(Thang Nguyen @ Mar 30 2007, 09:59 AM)

Hi,

I have a problem with the queue. After creating and using the queue to pass data, I try to flush queue then destroy it. But I meet this error:"Error 1 occurred at Release Queue in ...". I don't have much experience when working with a queue. Please give me some recommends on this issue.

THank you in advance for your time of reading and answering this question.

Thang Nguyen

How about some example code or a quick screen shot?

Neville.

Link to comment

QUOTE(Thang Nguyen @ Mar 30 2007, 02:19 PM)

I attach here the picture of creating the queue and destroy the queue.

Is the VI that creates the queue always in a run or reserved to run mode after they are created but before they are closed?

I am asking this because the error = 1 is invalid object. This will happen if the queue was already destroyed. Part of teh house keeping work done by LV is to keep track of resource that are allocated by each VI and releasing them when the VI goes idle.

So...

If the creators of the queues goes idle and or are unloaded form memory. LV will kiil the queue in your behalf.

Ben

Link to comment

QUOTE(Ben @ Mar 30 2007, 02:36 PM)

Is the VI that creates the queue always in a run or reserved to run mode after they are created but before they are closed?

I am asking this because the error = 1 is invalid object. This will happen if the queue was already destroyed. Part of teh house keeping work done by LV is to keep track of resource that are allocated by each VI and releasing them when the VI goes idle.

So...

If the creators of the queues goes idle and or are unloaded form memory. LV will kiil the queue in your behalf.

Ben

Thank you,

I also think about the case the queue is destroyed, but I did not destroy it. The VI that created the queue runs only one time at the beginning of the program. And when the program exit, I destroy the opject in the program. Then, I intend to flush and destroy the queue, but it's not work. Is there anyway to test if there is existing the queue in the memory or not? If it's already destroyed, I don't need to destroy the queue :).

Link to comment

QUOTE(Thang Nguyen @ Mar 30 2007, 09:31 PM)

Yes,

The 'http://zone.ni.com/reference/en-XX/help/371361B-01/glang/create_queue/' target="_blank">Obtaine queue' function has a boolean input that is: 'create if not found? (T)', and an output 'Created new?'.

Also you use a local to get your queue's from, maybe you run into some race condition, could you add your vi?

Ton

Link to comment

QUOTE(tcplomp @ Mar 30 2007, 03:45 PM)

Yes,

The 'http://zone.ni.com/reference/en-XX/help/371361B-01/glang/create_queue/' target="_blank">Obtaine queue' function has a boolean input that is: 'create if not found? (T)', and an output 'Created new?'.

Also you use a local to get your queue's from, maybe you run into some race condition, could you add your vi?

Ton

I solved it by use the read queue status. If it returns 1 I will make it 0 :). Otherwise, I will delete it. I don't know this is a good way or not?

The queue is used relating to many VIs, so I can not upload it :(. It's used to send data from the process of acquisition VI to logging VI.

Thank you for your help again.

Thang Nguyen

Link to comment

QUOTE(Thang Nguyen @ Mar 30 2007, 04:36 PM)

I solved it by use the read queue status. If it returns 1 I will make it 0 :) . Otherwise, I will delete it. I don't know this is a good way or not?

The queue is used relating to many VIs, so I can not upload all of them :( . I attach here the queue manager VI. It's used to send data from the process of acquisition VI to logging VI.

Thank you for your help again.

Thang Nguyen

You can also use the "Not a refnum?" primitive (found in the Comparison palette with all the Equals, Less than, etc primitives) to detect whether a Queue refnum is still valid or not. It returns boolean true/false so it might be simpler for you.

Link to comment

QUOTE(Aristos Queue @ Apr 1 2007, 12:35 PM)

You can also use the "Not a refnum?" primitive (found in the Comparison palette with all the Equals, Less than, etc primitives) to detect whether a Queue refnum is still valid or not. It returns boolean true/false so it might be simpler for you.

Thank you, it makes problem simpler :thumbup: .

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.