05-29-2024 09:10 PM
Estimados, tengo un código generado donde detecto los picos y valles de una señal simulada, lo que requiero es que en función de los controles booleanos de salida peak y valley cuando se active peak a la salida tener un 1 y mantenerlo hasta que se active valley y generar a la salida un 0. Esta salida 0/1 me servirá para controlar el sentido de giro de un motor
05-30-2024 12:50 AM
Hi m,
@m240597 wrote:
Dear, I have a generated code where I detect the peaks and valleys of a simulated signal,
I doubt you will detect all peaks/valleys of your simulated signal when you use the ToDDT function with the PtByPt-PeakDetector…
@m240597 wrote:
when peak is activated at the output, have a 1 and maintain it until valley is activated. and generate a 0 at the output. This 0/1 output will help me control the direction of rotation of a motor
Why use numeric 0/1 when you can use a boolean False/True?
It seems you want to react on rising edges of the peak/valley booleans: there is another PtByPt function named BooleanCrossing!
(To keep values for the next iteration(s) you should use shift registers or feedback nodes.)