Counting the amount of pulses
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!