EJW Posted November 21, 2008 Report Share Posted November 21, 2008 i have attached a picture of an inplace structure i used. does this method gain anything over not using it to do the same thing? Quote Link to comment
jdunham Posted November 21, 2008 Report Share Posted November 21, 2008 QUOTE (EJW @ Nov 20 2008, 12:16 PM) does this method gain anything over not using it to do the same thing? No. The basic reason is that you can't put ten pounds of stuff in a five-pound bag. Quote Link to comment
Minh Pham Posted November 21, 2008 Report Share Posted November 21, 2008 This is probably not the right way of using inplace element. It is design for working with element/structure which has the same size at both the input and output. Operations such as modifying data element within array, swap data between array indexies...without creating an extra memory buffer, hence performance is improved. Building a new array based on the data from the inplace element (IPE) input node will not help as you are increasing the size of the IPE output, as the result, LV still has to organize buffer for the operation described. Quote Link to comment
EJW Posted November 22, 2008 Author Report Share Posted November 22, 2008 QUOTE (Minh Pham @ Nov 20 2008, 06:52 PM) This is probably not the right way of using inplace element. It is design for working with element/structure which has the same size at both the input and output. Operations such as modifying data element within array, swap data between array indexies...without creating an extra memory buffer, hence performance is improved. Building a new array based on the data from the inplace element (IPE) input node will not help as you are increasing the size of the IPE output, as the result, LV still has to organize buffer for the operation described. Actually, i am replacing the third element with new data, same size. I keep the first two indexes and input a new third array to replace the original. Quote Link to comment
asbo Posted November 22, 2008 Report Share Posted November 22, 2008 QUOTE (EJW @ Nov 21 2008, 09:43 AM) Actually, i am replacing the third element with new data, same size. I keep the first two indexes and input a new third array to replace the original. I think the problem is that you're using the Build Array to create a completely new array - not working on the old one. Why not use the Replace Subset function? Quote Link to comment
jdunham Posted November 22, 2008 Report Share Posted November 22, 2008 QUOTE (EJW @ Nov 21 2008, 06:43 AM) Actually, i am replacing the third element with new data, same size. I keep the first two indexes and input a new third array to replace the original. asbo has it right. You aren't telling the LV compiler any more than you were telling us, and we didn't understand either. You have to throw it a bone. Put another way, you may know that the array will stay the same size, but the LabVIEW compiler has to generate code which will always work, no matter what you may have dropped into the local variable at some point. Once you do the right thing and use replace subset, you don't need the inplace compiler hint anymore, because the Replace function always operates inplace. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.