LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search 1D array doesn't works.

Solved!
Go to solution
Solution
Accepted by Fird

Another option would be to see if the absolute difference is below a certain threshold. (see image marked in green)

 

 

Your code has quite a few very inefficient constructs, for example

  • to go from a 2D array to a 1D array, you would use "index array" and not convert to dynamic data and back. remove the built array inside the lower right corner loop and the means array will be 1D to begin with. Change the indicator accordingly to a 1D array.
  • You also make excessive overuse of local variables. Never read a local variable inside a tight loop unless you expect it to change during the execution of the loop. As an example, look for your use of the "elements" locals. Delete them and wire from the terminal! (see image in blue)
  • After you search for the index, you use "array subset" in the pressure trace, but "delete from array" for the alpha array. Since you delete zero elements, the function has no purpose.
  • You code is much more complicated than it has to be. I am sure it could be done with half the code.
Message Edited by altenbach on 05-12-2009 08:31 AM
Message Edited by altenbach on 05-12-2009 08:36 AM
Message 11 of 14
(742 Views)

Dennis,

 

I've done as you suggest. However, it still doesnt works where the index didnt select the real number as needed which is 0.0253858.

 

Firdaus

ps : refer attachment.

0 Kudos
Message 12 of 14
(740 Views)

Then it doesn't exist in the array. Run the VI so that there is data in the indicators adn then go to Edit>Make Current Values Default. Save the VI. Post that.

 

You should also use the Include upper limit with the In Range function.

Message 13 of 14
(729 Views)

Norbert, Dennis, and Altenbach,

 

I manage to solve the problem already using the method suggested by Altenbach.

 

Thanks a lot guys.

 

Firdaus

0 Kudos
Message 14 of 14
(721 Views)