LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue bug

Hello,

 

I have just experienced a very painfull application problem. It is hard for me to disect the code as I am in time pressure.

 

Problem : Element waiting fucntions time out, when the code is highlighted. When not, these work just fine.

 

Bug.png

You can see, that the timeout input of the "Preview queue element function" is -1. Still the function times out immidietly.

 

Labview 2012 SP1, w7 32bit

 

I was not able to reproduce this error in some simple code (it didn't happen).

 

Anyone else experienced this ?

0 Kudos
Message 1 of 10
(3,309 Views)

@Bublina wrote:

Hello,

 

I have just experienced a very painfull application problem. It is hard for me to disect the code as I am in time pressure.

 

Problem : Element waiting fucntions time out, when the code is highlighted. When not, these work just fine.

 

Bug.png

You can see, that the timeout input of the "Preview queue element function" is -1. Still the function times out immidietly.

 

Labview 2012 SP1, w7 32bit

 

I was not able to reproduce this error in some simple code (it didn't happen).

 

Anyone else experienced this ?


Like the doctor said.  "If it hurts, then don't do it!"  Highlight execution is a debugging tool, and like running a trace on a text based language, it will probably make things run differently than it does without it.

 

Probably the scarier thing is:

Why are you using preview queue element in the first place?  Are you dequeuing in several places?  Shame on you if you are.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 10
(3,278 Views)

Yeah, I used to dequeue and run the fellow data through shift register, but then I decided to keep it in the queue until I really need it. Giving it a second thought, it is not too bright, since LabView probably does create a full copy once you preview/dequeue it, no matter you only need a part of the data. So it doesn't really save any resources.

 

Edit: Actually I think it doesn't 🙂

0 Kudos
Message 3 of 10
(3,269 Views)

Bublina,

 

Check the error out of the "Preview Queue Element" function when you have the problem.

(You'll have to create a wire going to the Case structure to probe or create an indicator.)

 

My guess is that you have Automatic Error Handling turned off (VI Properties -> Execution).

If this is true, you wont see an error with Highlighting turned on.

 

You should not turn off Automatic Error Handling unless you are going to handle the errors yourself.

Since you didn't wire the Error Out terminal, you would be ignoring errors from that function (not recommended).

 

For example: If the queue reference is not valid, you will get exactly the results you are seeing.

 

The attached vi (LV 2012) illustrates the effects of a bad queue reference.

 

steve

 

 

 

 

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 10
(3,222 Views)

Thanks for suggestion, unfortunately it is not the case. The automatic error handling is on (I never turn it off)

The code in the image is pretty much butchered already as I did quite a lot of stuff to figure it out...

0 Kudos
Message 5 of 10
(3,216 Views)

Well, it was worth a shot ...

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 10
(3,204 Views)

The first thing that comes to mind is a timeout will occur if the queue reference is invalid, along with error 1122. Stick a probe on the Queue Ref out from the preview queue, and probe the error out too. 

 

Alternatively, if you are only running the highlight execution on the preview element code, would the dequeue code be interfering? 

 

To echo billko, are you certain that the preview is being used appropriately? I can't tell what the overall architecture is, so I can't really comment - it's just some food for thought.

_____________________________
- Cheers, Ed
0 Kudos
Message 7 of 10
(3,158 Views)

Thank you for your suggestions, unfortunately I was not able to find any problem with my code, and it really works just fine if I do not debug using highlight.

 

I will try to reproduce the error.

0 Kudos
Message 8 of 10
(3,155 Views)

One thing which is important to know about Highlight Execution is that it puts the complete execution code into a single thread.

Is it possible that this error is connected to the fact that you have no parallelism in your VI anymore?

 

And checking for a valid queue reference is also a good thing.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 10
(3,153 Views)

I will look into this. Thank you. 

0 Kudos
Message 10 of 10
(3,129 Views)