取消
显示结果 
搜索替代 
您的意思是: 

Error ring excluded in executable?

Hello,

 

I encountered following strange behavior: when run in LabVIEW development, following error ring does its expected job as it also acts as a control flow control so that the reference is not destroyed before the loop terminates (see picture).

 

Strangely, when I build an executable and execute the VI via run-time, I the reference is destroyed WHILE the loop is still running. As if the error ring was not compiled into the executable.

 

Is it a LV bug?

 

Thanks,

 

Peter

 

LVref.png

0 项奖励
1 条消息(共 25 条)
6,023 次查看

While it might be possible that this is the case (the ring is an XNode and I suppose it is theoretically possible that there are some holes in that department), I would say it doesn't seem to be likely for something as basic as this. I would suggest making sure (e.g. by adding logging to see whether the loop is still running, whether the code to destroy the DVR was actually called, etc.). You could also try replacing the ring with a constant or a clear errors VI.

 

Other alternative explanations would be that you destroy the DVR elsewhere, that the DVR isn't destroyed and you're misinterpreting the behavior or that the DVR is destroyed automatically because the hierarchy it was created in has gone idle.


___________________
Try to take over the world!
0 项奖励
2 条消息(共 25 条)
6,013 次查看

I see you are already passing out another error cluster from the loop.  Why not use that error cluster?  The Destroy DVR function will still work if there is an error (or so the help file for it claims).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 项奖励
3 条消息(共 25 条)
6,007 次查看

I managed to reproduce the problem in LabVIEW development if I disable debugging for this VI.

 

It seems to me that the compiler moves this part of the code outside the loop as static content. In this case, I would consider it as a bug, as the compiler shouldn't change the semantic of the program.

 

What do you think?

0 项奖励
4 条消息(共 25 条)
5,981 次查看

@Bokor wrote:

I managed to reproduce the problem in LabVIEW development if I disable debugging for this VI.

 

It seems to me that the compiler moves this part of the code outside the loop as static content. In this case, I would consider it as a bug, as the compiler shouldn't change the semantic of the program.

 

What do you think?


I don't see this as a bug.  There are some in LabVIEW R&D that say that using the error wire to force a data dependency is a hack.

 

I still go back to the fact that you should just be using your other error wire or wire your DVRs through your loop.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 项奖励
5 条消息(共 25 条)
5,971 次查看

@crossrulz wrote:

I don't see this as a bug.


I would. Hack or not, the paradigm we rely on is that wires determine execution order and I'm not aware of any change that NI made to that rule (notable kind-of-exceptions - inputs into later frames of a flat sequence not affecting the earlier frames and iteration order in a parallel loop, but tha's not really wires).

 

That said, we would need to see some actual code demonstrating the behavior.


___________________
Try to take over the world!
0 项奖励
6 条消息(共 25 条)
5,965 次查看

Here you go (LabVIEW version 2014).

 

Just by enabling/disabling debugging for main.vi can you switch between "I'm alive" (valid DVR) and "Dereference error" (destroyed DVR).

 

There may be different views whether or not it's a bug (I tend to agree that it is), but at least it should be documented..

0 项奖励
7 条消息(共 25 条)
5,955 次查看

I agree that it looks like a bug and I'll report it.

 

Also, here's a simpler version of the behavior (2013).


___________________
Try to take over the world!
0 项奖励
8 条消息(共 25 条)
5,936 次查看

I agree that this is a bug with a capital 'BUG'. 

 

It is a compiler optimization run amok.  

 

Any node which ignores input errors (Release Queue, Close Reference, etc.) will do the trick.

 

The error ring is also fungible.  Create a Diagram Disable structure with an error output (use a constant if you want) wired in the disable case.  In the enabled case simply use the tunnel with the 'Use Default if Unwired' option.

 

DataflowOops.png

 

Snippet mangled the simpled 'This VI constant, but this also shows the bug.

0 项奖励
9 条消息(共 25 条)
5,921 次查看

And the error ring has nothing to do with it really.  But lets look at what we did that is a bit odd

 

Dropping back to the concept here

Shows how to correctly use the DVR functions thusly:

Capture1.PNG

Go read it yourself and compare to the simplified example attached above.

 

Finally Modifying the example to:

Capture.PNG

CURES the unexpected behavior!

 

DVR Write DVR output unwired should probably have thrown at least a compiler warning.

 

I'm fairly certain that one should not wire a DVR Ref Around a parallel DVR Access that may modify the data (Something scares me there).

 

So Bug? Yes, I think the behavior is not as intended.  Workaroud? Don't wire a DVR Ref around a parallel DVR Access that may modify the data


"Should be" isn't "Is" -Jay
0 项奖励
10 条消息(共 25 条)
5,915 次查看