LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hi guys

Hi am facing problem in my project could you guys help me out.In my project am unable to ge the number of replacements in search and replace function.Am here attaching both block diagram and front panel,in this the input array is dynamic. Am getting values from different devices forget those devices in that i have no problem.Am facing the problem in the loop.
 
 
Else guide me how to search and delete from the array..
 
I hope you guys will help me.
 
 
                 Thank You Guys.
Download All
0 Kudos
Message 1 of 5
(2,473 Views)

Hi seeni,

here is an example about how to delete elements from the array. Which LabView Version do you use? With LV8.5 it is possible to replace all searched strings and the result is the number of replaced strings. The example is in LV71 and shows how you can do it with arrays.

Hope it helps.

Mike

0 Kudos
Message 2 of 5
(2,444 Views)
Please attach your real program, you code makes no sense to me.
  • The first loop is unecessary and can be replaced by "array subset".
  • Why do you work with strings instead of numbers. (sure there could be problems comparing DBLs due to binary limiations, but that could be handled in some other way). Working on strings is much less efficient.
  • What is the purpose of the shift register in the second loop? The data in it never changes. A plain input tunnel is sufficient.
  • Do you want to take the average of all nonzero elements?. Do you still want the zeroes in the output array?
  • Instead of replacing with zero, you could just built a new array with all the desired numbers deleted. This can be done very efficiently "in place". Using "delete from array" in a loop as in the above example is NOT recommended.
0 Kudos
Message 3 of 5
(2,420 Views)
Also, it's using the Search 1D Array with DBLs, which probably won't work right if the data is coming from devices, due to floating point number comparison issues.

It seems to me that the user is just wanting to get the average of a list of numbers with certain values not included. In that case, something as simple as this would do it:



The "True" part just passes the values through.



Message Edited by smercurio_fc on 04-21-2008 01:18 PM
0 Kudos
Message 4 of 5
(2,408 Views)

Here's another alternative (draft!). Modify as needed.



Message Edited by altenbach on 04-21-2008 11:38 AM
Download All
0 Kudos
Message 5 of 5
(2,393 Views)