08-20-2020 05:14 AM - edited 08-20-2020 05:18 AM
@GerdW
Yes this part will not work all the time.
Thanks for pointing out.
Corrected.
08-20-2020 07:47 AM
08-22-2020 02:09 AM
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,
08-22-2020 09:56 AM - edited 08-22-2020 10:19 AM
08-23-2020 10:01 PM
@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.