LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger increse?

Solved!
Go to solution

Hi everyone,😀

I'm new on labview and I need some help to trigger the increment of all items of 1D array. Basically, what i need to do is when elements of "#found" increse by one, a led should light.

Anyone could help me?

Thank you!

Immagine 2022-05-03 095654.jpg

0 Kudos
Message 1 of 4
(1,248 Views)

Hi Dave,

 


@DaveDano wrote:

Immagine 2022-05-03 095654.jpg


At first you should cleanup the block diagram before posting images of it.

Then usually we prefer real code instead of images of code…

 


@DaveDano wrote:

I need some help to trigger the increment of all items of 1D array. Basically, what i need to do is when elements of "#found" increse by one, a led should light.

Please explain what you are trying to achieve!

  • Why do you run the loop multiple times but only use the result of the last iteration?
  • Why is there a loop at all when all inputs stay constant?
  • Do you want to examine the values of the elements of that "#found" array?
  • Do you want to evaluate the number of elements of the "#found" array?
  • Which LED should be activated?

Just a guess:

You want to indicate when you detect one more peak than in the previous check: you need to store the number of peaks in a shift register and compare current with previous value. That shift register belongs to the outer loop, which is not shown in your image…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(1,235 Views)


Hi GerdW,


@GerdW  ha scritto:

At first you should cleanup the block diagram before posting images of it.

Then usually we prefer real code instead of images of code…


I know but sorry I'cant show it all because it's an industrial application.

 

Please explain what you are trying to achieve!

  • Why do you run the loop multiple times but only use the result of the last iteration?

I do loop multiple times because i have three channels, the waveform input of peak detector it's a waveform made up by three signals.

I also need to know the number of peak detected.

 

  • Why is there a loop at all when all inputs stay constant?

As I said before , the input waveform that enter in the peak detection is formed by three signals sampled every 500ms ( yes it's correct, the image that i show to you is contained in while loop.)

 

  • Do you want to examine the values of the elements of that "#found" array?

Yes, I do when the value of one array element increse i need to put a light

 

  • Do you want to evaluate the number of elements of the "#found" array?
  • Which LED should be activated?

The Led isn't in the code, but it's not a problem, i don't understand how to compare the old value of "#found" with the new one.

Yes your guess is correct, i need to detect the incresing of peaks, so i have to put the shift register on while external loop?

 Thaks you very much for your help!!

 

Dave





 

0 Kudos
Message 3 of 4
(1,218 Views)
Solution
Accepted by topic author DaveDano

Hi Dave,

 


@DaveDano wrote:
I do loop multiple times because i have three channels, the waveform input of peak detector it's a waveform made up by three signals.

As I said before , the input waveform that enter in the peak detection is formed by three signals sampled every 500ms ( yes it's correct, the image that i show to you is contained in while loop.)

 

Yes your guess is correct, i need to detect the incresing of peaks, so i have to put the shift register on while external loop? 


Right now the code inside the loop (PeakDetector) always gets the very same input data with each iteration, so it makes no sense to put it in the loop!

And yes, that shift register belongs to your outer while loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(1,193 Views)