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.
08-10-2020 09:57 AM
Hi There, looking for a little bit of help if possible.
I am taking some measurements from my signal analyser and from the resultant measurements separating out the frequency components into a 1D array which seems to be the easiest part... in the 1D array I should always have the main frequency component, but also a number of spurious harmonics, however, I have a list of five harmonics that are acceptable, all others would result in a failure.
So essentially I want to take my 1D array of strings, compare it with my list of acceptable values, and return a fail if anything is outside of the list.
TIA
08-10-2020 10:39 AM
Nested For Loops... Outer one iterates over each value of your 1D Array and inner one iterates over the array of acceptable values.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-11-2020 04:44 AM
Hi Andrew thanks for your response.
vi attached with where I got to...
I've used a for loop with a case structure containing a "search 1D array", this is then returning an array containing index of elements... so what I want now is if the output array contains a '-1', i.e. one of the input elements did not match, then it results in a fail, is there an easy way to search the array for the -1?
08-11-2020 06:51 AM - edited 08-11-2020 06:54 AM
Yes, just do it within your For Loop while you are indexing though... See below. Also, you've already told your For Loop how many times to run by indexing over your 3 element array, you don't need to take the array's size and wire it to N too. That's redundant.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
08-11-2020 07:01 AM - edited 08-11-2020 07:04 AM
I did it in the following way in the end, but thanks for your help, very much appreciated.