From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-26-2014 06:36 AM
I would like to eliminate the element in an array . Here say I want to eliminate all the cells with "0" or "Empty" and put only elements other than "0" or Empty into an new array. Without leaving any space or Cell with emptiness. I had tried and I am having a problem. I had also created a array as expected result.
Here with I post it. Can any one give a solution.
Thank you
With regards
04-26-2014 07:33 AM
Hi,
Use the Array search function instead of String functions.
You can search for a particular element (zero) in the array and use the index to delete or replace with the element required.
I have added screen shot of the LabVIEW functions, which searches the Zero and deletes from the Array.
Hope this helps
04-26-2014 07:39 AM
Hai Vijay,
Thank you. What do u do in False case. Can you send me as VI if possible. So that I can have look. Because I tried similar one before, but in False case still some value either as zero or as empty is getting appended in the new array. I want to know how to block sending data in False case. It would nice if you attach your solution VI so that I can run and see. I am using Labview 2012. Looking forward to hear from you.
Thank you for the same.
With regards
04-26-2014 08:07 AM
I have added the modified VI. All the best.
04-26-2014 11:11 AM
Never use "delete from array" in a tight loop! You should adapt something like this instead.
04-26-2014 11:26 AM - edited 04-26-2014 11:26 AM
@Johannes4u wrote:
I would like to eliminate the element in an array . Here say I want to eliminate all the cells with "0" or "Empty" and put only elements other than "0" or Empty into an new array. Without leaving any space or Cell with emptiness. I had tried and I am having a problem. I had also created a array as expected result.
Your array of expected resuts contains a lot of elements with empty strings so that does not seem right! Please check your code.
Since you have LabVIEW 2012, you can use the conditional tunnel to do exactly what you want with very little code. Here's an example.
04-26-2014 11:35 AM - edited 04-26-2014 11:36 AM
And here's how you would do it without conditional tunnels. Same result. (the other case is ["", "0"] and is simply wired across).
04-28-2014 06:30 AM
Here's a thread over on LAVA that is a good read. We went through trying to improve the OpenG Array functions. You'll find some interesting tricks in there.
05-01-2014 03:12 AM
Thank you Mr. Altenbach.
With Regards