Counting the amount of pulses

조회 수: 3 (최근 30일)
Hans Vertongen
Hans Vertongen 2016년 4월 6일
답변: Debarati Banerjee 2016년 4월 11일
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

답변 (1개)

Debarati Banerjee
Debarati Banerjee 2016년 4월 11일
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.

카테고리

Help CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by