05-11-2019 06:01 AM
Mr kevin
i have counted no gmr and encA pulses in between z index.
please would share logic how to write code to find # enc A pulses between first 2 GMR pulses *after* a Z pulse
thanks in anticipation
05-13-2019 10:31 AM
It looks like you made 2 copies of the algorithm I posted, but it isn't clear what you've done to *understand* it. You'll *need* to understand it because you have different kinds of evaluation conditions and some of them may have tricky boundary conditions. For example, when you want to count pulses "after" something or "between" two things, how will you handle cases where things are simultaneous? Do they or don't they count as "after" or "between"?
So let's try things this way. Write a brief text description of an algorithm that you think should do what you want. Then try to implement that algorithm in LabVIEW code. Evaluate your results. Adjust algorithm/code as needed. Put some time into tinkering. If you get stuck again, *then* post back with the text algorithm, the LabVIEW code, and some description of what you discovered and changed during your troubleshooting.
For example, here's my text description of the algorithm I posted:
1. Identify sets of indices for rising edges of both GMR and encA signals.
2. For each consecutive pair of GMR indices, identify which encA indices fall between them. (Simultaneous indices count as falling between.)
3. Count them.
Both text description and code implementation are important for troubleshooting. Sometimes the error is in the logic of the algorithm description, sometimes it's in the code. (And sometimes both.)
-Kevin P