Thang Nguyen Posted March 31, 2007 Report Share Posted March 31, 2007 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 Quote Link to comment
Neville D Posted March 31, 2007 Report Share Posted March 31, 2007 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. Quote Link to comment
Thang Nguyen Posted March 31, 2007 Author Report Share Posted March 31, 2007 QUOTE(Neville D @ Mar 30 2007, 01:10 PM) How about some example code or a quick screen shot?Neville. I attach here the picture of creating the queue and destroy the queue. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted March 31, 2007 Report Share Posted March 31, 2007 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 Quote Link to comment
Thang Nguyen Posted March 31, 2007 Author Report Share Posted March 31, 2007 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 . Quote Link to comment
Ton Plomp Posted March 31, 2007 Report Share Posted March 31, 2007 QUOTE(Thang Nguyen @ Mar 30 2007, 09:31 PM) Is there anyway to test if there is existing the queue in the memory or not? 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 Quote Link to comment
Thang Nguyen Posted March 31, 2007 Author Report Share Posted March 31, 2007 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 Quote Link to comment
Ton Plomp Posted April 1, 2007 Report Share Posted April 1, 2007 Hi Thang, you should do a search for destroy queue in your VI's most likely you have more than 3! Is there any reason to flush the queues before destroying them? Ton Quote Link to comment
Aristos Queue Posted April 2, 2007 Report Share Posted April 2, 2007 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. Quote Link to comment
Thang Nguyen Posted April 2, 2007 Author Report Share Posted April 2, 2007 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: . Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.