LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Don't use the "in place element" structure?

I think this is a serious bug in the In Place Element structure.  It makes no sense at all.  Please have a look at the block diagram (png) attached.  Can anyone explain this to me?  I've also attached the code.  As far as I'm concerned, I won't use this structure anymore -- it is unreliable.

--Dave


Download All
Message 1 of 13
(7,673 Views)
Thanks for bringing this to our attention. Your example adequately demonstrates the problem. I've filed a bug report (CAR# 4I4LKLV2) to one of our engineers for further investigation.

I believe I know the basic reason this is happening, but that is not to say it's not a bug. The issue seems to be related to the fact that LabVIEW is forced to make a copy of your cluster being indexed and replaced by the In Place Structure. You can verify this copy is being made using the Show Buffer Allocations tool (Tools >> Profile >> Show Buffer Allocations). LabVIEW needs to make this copy because you are reading the current recipe_len value and overwriting it in parallel. So LabVIEW makes a backup copy so that these operations can be performed at the same time. There are many ways you can force LabVIEW not to make this copy, which I'll show below. I want to be sure that you know, however, that you shouldn't have to know about these methods to properly use the In Place Structure.

A workaround would be any of the attached methods, or simply to manually index and replace the elements in the array. Hope this helps and thanks again.

Jarrod S.
National Instruments
Message 2 of 13
(7,654 Views)

Hi Dave,

i think your are right that there is something wrong, but you can use this structure when change a littleness. See the picture.

Mike

Message 3 of 13
(7,608 Views)
Hi All,

I am jumping into this thread a little bit late, but hopefully it is still alive.

Is this "behaviour" (which is certainly a bug) as reported by the original post something I should be worried about?? I have only just read this thread and, as fortune would have it, am in the middle of replacing a lot of code that used unbundle/bundle or index/replace with the in place structure.

Has anyone else used the in place structure effectively in a large project?

<edit>
After re-reading Darren's post and noticing his example, am I correct in assuming this only affects other wires your bring out of the in place structure, and then only in specific circumstances? Hopefully I should be safe then as I only use the primitives added by right-clicking (i.e. unbundle/bundle etc), and do not take "other" wires out of the structure.
 



Message Edited by nrp on 03-31-2008 06:02 PM
0 Kudos
Message 4 of 13
(7,303 Views)
Hi nrp,


As mentioned above, a CAR has been filed for this issue and R&D is aware of it. For now, you can be safe using the workarounds provided by Jarrod above.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 5 of 13
(7,226 Views)
I strongly suggest using one conventions. Like at attached example. If you using In Place to array operation, use also for cluster operations: for me it works fine.
Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
0 Kudos
Message 6 of 13
(6,994 Views)
Yes... I've just found this same at "Structure_problem_workarounds.vi"
Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
0 Kudos
Message 7 of 13
(6,990 Views)

I know this is a very old thread, but if I faced an odd problem with In Place Element structure(IPE)- where I used 2 subVI's in IPE in my Real-Time application. My application runs fine in run time from the computer, however, after deployment it appears as broken with no error details. Apparently, I removed one small subVI(that uses basic math functions- multiplication and division- not much) from IPE and kept another subVI (that has lots of for loop and arrays) in IPE from IPE, deployment application works fine. The irony is just by removing small subVI it works, but if I bring back the small subVI and removes the big subVI- it doesn't work.

 

Does anyone has tested using subVsI in IPE? NI needs to give some recommendations on that.  I know using subVIs in IPE voids the idea of IPE as subVI's will create copies of data - still I am curious because it gave me a lot of trouble.

0 Kudos
Message 8 of 13
(3,203 Views)

Your problem does not sound related at all other that it also uses an IPE. And yes I use the IPE regularly, also with subVIs inside and on RT too, so you will need to provide more information.

 

I recommend to create a new topic instead of attaching to a 13 year old thread that is only very remotely related to your problem and also attach an example code that shows the issue.

Rolf Kalbermatter
My Blog
Message 9 of 13
(3,188 Views)

Are the VIs inlined?

 

Try forcing a recompile of all the VIs from where the changes were made right up to the top-level VI. Or just empty your compile cache, we see problems like these all the time and have started defaulting to clearing the compile cache because it tends to be the most common denominator.

Message 10 of 13
(3,117 Views)