04-12-2014 09:45 AM - edited 04-12-2014 09:49 AM
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.
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 ?
04-12-2014 11:40 AM
@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.
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.
04-12-2014 11:57 AM - edited 04-12-2014 11:58 AM
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 🙂
04-13-2014 07:42 PM
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
04-13-2014 07:47 PM
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...
04-13-2014 08:45 PM
Well, it was worth a shot ...
04-14-2014 06:46 AM
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.
04-14-2014 06:51 AM
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.
04-14-2014 06:51 AM
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
04-14-2014 07:54 AM
I will look into this. Thank you.