ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

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

Unxepected behaviour with clusters inside of while loop with shift register

Colleagues,

 

I just would like to post here small, but important bug (I guess this is the bug), which was found by coworker today morning. Just would like to share knowledge, and probably this will save some debugging time for you...

So, the problem that you can get wrong content of the cluster in some cases. The cluster used inside of while loop with shift register (we using this construction for functional globals), and after bundle operation you can get data, which are not expected:

See also attached code for details (LabVIEW 8.6.1, WinXP Prof SP3).

 

best regards,

Andrey.

PS

Bug report already sent to NI.

Message Edited by Andrey Dmitriev on 10-16-2008 12:30 PM
下载全部
1 条消息(共 10 条)
6,171 次查看

Hi,

 

Please could you post your code in 8.5.

Does the bug exist in 8.5?

 

Thanks

Dave

 

.

0 项奖励
2 条消息(共 10 条)
6,147 次查看

Yep. In LabVIEW 8.5.1 this trouble also present as well.

 

Andrey.

0 项奖励
3 条消息(共 10 条)
6,143 次查看
Interesting andrey!!!!
0 项奖励
4 条消息(共 10 条)
6,140 次查看

In addition:

 

Just putting one-frame sequence around bundle operation will also solve this problem:

Andrey.

Message Edited by Andrey Dmitriev on 10-16-2008 02:01 PM
5 条消息(共 10 条)
6,133 次查看

Heres another workaround. Do the bundles separatly, in order.

Dave

 

 

 

 

Message Edited by DavidU on 10-16-2008 01:24 PM
6 条消息(共 10 条)
6,110 次查看

Thanks Andrey for brining this to our attention!

 

The "Show Buffer Allocations" reveals that LV is not processing the code in the right order.

 

 

Under ideal conditions, all of the data should be manipulated using the buffer "A". But as this demo shows the data is being processed in the wrong order.

 

The previously posted workaround get around this by forcing the array operation to happen first, but this resluts in two additional buffers "C" and "D" and then copy this back into "B".

 

Using an "Always Copy" is another workaround that uses a seperate buffer "F" to hold the data being moved from the first cluster to the second inside "E".

 

I think you won a shinny new CAR* Andrey!

 

Ben

 

CAR = Corrective Action Report

Message Edited by Ben on 10-16-2008 08:05 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
7 条消息(共 10 条)
6,086 次查看

Thanks, Ben for the most elegant "Workaround"!

Now I know how to use "Always Copy" properly! Newer used it before...

And now I understand what mean this sentence in Help: "...Use this function when you want to control LabVIEW's compiler in order to produce a different result regarding its buffer allocations..."

眨眼表情 

 

Andrey.

 

0 项奖励
8 条消息(共 10 条)
6,053 次查看

Hi,

 

This was reported to R&D (# 131499) for further investigation. Thank you everybody for all the information and for posting the workarounds.

Message Edited by Nitin T on 11-05-2008 04:43 PM
9 条消息(共 10 条)
5,797 次查看

I can't open the VI because it is in 8.6

what I can see is that you are using 2 clusters within the main cluster.

 

I might be asking a dumb question here.....

Are these 2 clusters identical?

 

I tend to use controls (strict typedef's) to ensure that they are the same.

If you change the order of the elements they can misbehave.

 

This is easy to do if the cluster was created using "build cluster" instead of build cluster by name.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 项奖励
10 条消息(共 10 条)
5,790 次查看