LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change of input parameters at each for-loop iteration

Dear all,

 

It would be very nice if somebody could give me some help and suggestions for the following:

 

Situation:

 

As an example shown in the attached program “changed input at for_loop.vi” I have a signal with e.g. three peaks. I am splitting the raw waveform signal in its single peak arrays, using the “Array Subset.vi” three times. For each single peak I am using a pair of input parameters (which are manually set), namely a “peak start index” value and a “peak length” value. In parallel to the peak splitting, a threshold position for each single peak is determined by using the “Threshold 1D Array.vi” function.

 

 

Problem:

 

This procedure works fine, but is not very flexible because for each additional peak I have to add an additional “Array Subset.vi” and “Threshold 1D Array.vi” function.

 

1. Because I will have more than 3 peaks, I would like to place one “Array Subset.vi” and “Threshold 1D Array.vi” function in a for-loop, so for each peak the loop iterates once and produces as output the single peak array and its threshold value.

 

For this situation, the input parameters at each for-loop iteration have to change to the manually set values for each of the peaks. How can I do this?

 

2. Additionally, I would like to “switch off” peaks using a Boolean true/false. For example I am switching off peak 2. That would mean that peak 1 in the first iteration of the loop would be processed. Peak three would be processed in the 2nd iteration and not in the 3rd iteration. How can I do this?

 

 

It would be very nice if somebody could help me with this.

 

Kind regards,

 

Beam

 

0 Kudos
Message 1 of 3
(3,185 Views)

Hi,

You can do that by having an array with the settings and conect that to a for loop, it will auto index that array and run as many times as you have settings

I changed your vi, take a loop at the attachment.

Hope this helps,

Paulo

0 Kudos
Message 2 of 3
(3,177 Views)
Hi, I forgot the on off...
 
0 Kudos
Message 3 of 3
(3,170 Views)