LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate signal area

@GerdW

 

Yes this part will not work all the time. 

 

Thanks for pointing out.

 

Corrected.

PBP
Labview 6.1 - 2019
0 Kudos
Message 11 of 15
(904 Views)

Hi PBP,

 

one more point: all your FOR loops can run too many iterations based on what they do: the last iterations might index non-existing array elements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 15
(894 Views)

Hi GerdW,

 

Can you throw some light how can I avoid some for loop when I want to do calculations online? I am using this method to detect start and stop of my waveform.

 

Regards, 

PBP
Labview 6.1 - 2019
0 Kudos
Message 13 of 15
(880 Views)
  • What is your definitition of "calculation online"? Where exactly is that?
  • You can subtract 3 from all your values wired to N.
  • Your loops differ very little. I am sure you could combine the bulk of the code to avoid all that repetition.
  • It is a really bad idea to place user files into the root folder (C:\data.csv).
  • Your code does not work right if the first peak is negative.
0 Kudos
Message 14 of 15
(870 Views)

@altenbach

 

1) What is your definitition of "calculation online"? Where exactly is that?

Calculation online means this is performed on live data not on the past data. Where I don't know at what sample my cycle will start. Position of peak will very anywhere between samples I captured.

2)Your loops differ very little. I am sure you could combine the bulk of the code to avoid all that repetition.

This is just example code actual code contains subVis for code repetition. 

3) It is a really bad idea to place user files into the root folder (C:\data.csv).

This is just example for Rani_jcha's question. Path can be anything.

4)Your code does not work right if the first peak is negative..

In my case I am capturing sine wave signal and I do soft firing of TRIAC, so I always get positive peak first.

PBP
Labview 6.1 - 2019
0 Kudos
Message 15 of 15
(854 Views)