From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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
Download All
Message 1 of 10
(4,995 Views)

Hi,

 

Please could you post your code in 8.5.

Does the bug exist in 8.5?

 

Thanks

Dave

 

.

0 Kudos
Message 2 of 10
(4,971 Views)

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

 

Andrey.

0 Kudos
Message 3 of 10
(4,967 Views)
Interesting andrey!!!!
0 Kudos
Message 4 of 10
(4,964 Views)

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
Download All
Message 5 of 10
(4,957 Views)

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

Dave

 

 

 

 

Message Edited by DavidU on 10-16-2008 01:24 PM
Message 6 of 10
(4,934 Views)

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
Message 7 of 10
(4,910 Views)

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..."

Smiley Wink 

 

Andrey.

 

0 Kudos
Message 8 of 10
(4,877 Views)

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
Message 9 of 10
(4,621 Views)

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 Kudos
Message 10 of 10
(4,614 Views)