Borrar filtros
Borrar filtros

Counting the amount of pulses

1 visualización (últimos 30 días)
Hans Vertongen
Hans Vertongen el 6 de Abr. de 2016
Respondida: Debarati Banerjee el 11 de Abr. de 2016
Hello,
I'm using a GUI to monitor a system. In this system there is an encoder that generates pulses if an engine (crankshaft) is turning. Now I need something that counts the amount of pulses that have been generated until another pulse (from another device) is given. So to be clear, there are two different channels of pulses.
Has anyone an idea of how I can do this?
With Regards Hans Vertongen

Respuestas (1)

Debarati Banerjee
Debarati Banerjee el 11 de Abr. de 2016
You can use the block 'Detect Rise Positive' to detect the rising edge of each pulse. You may set the output of this block to 'uint8' and use a 'Memory' blck to add and count the total number of pulses. This way you can count number of pulses in one channel (say A channel)
Next, you mentioned that you need to count the number of pulses in one channel (say,A) until one pulse in the other channel (say, B)is generated. To develop this system, you may put the former model in a 'Enabled Subsystem'/'Triggered Subsystem' depending on your use case and as the triggering signal you should use the channel B.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by